Get window size

  • #10, z HelixAbyssTuesday, 26. January 2016, 01:38 hodinky 9 years ago
    Is this what you're looking for?

    game.WindowResolution.x
    game.WindowResolution.y
    

    Bažant

    24 Posts


  • #11, z afrlmeTuesday, 26. January 2016, 11:43 hodinky 9 years ago
    No... that just returns the game resolution - or at least that's what it is supposed to do.

    Imperátor

    7285 Posts

  • #12, z sebastianTuesday, 26. January 2016, 13:08 hodinky 9 years ago
    No... that just returns the game resolution - or at least that's what it is supposed to do.

    yes, its only returning the defined game resolution

    Kapitán

    2346 Posts

  • #13, z MachtnixThursday, 28. January 2016, 00:18 hodinky 9 years ago
    Has someone worked with the
    http://wiki.visionaire-tracker.net/wiki/Read/Write_Config.ini_(CMS)-script?

    It's a very huge one and I don't understand, what I have to do and how it works. I only want to let the player decide to start at fullscreen or at the fixed resolution (windowed). Thats all. Two buttons. Creating a game it will only start at full screen. So I need to change only the resolution at a start menu.

    Machtnix

    Kapitán

    1097 Posts

  • #14, z afrlmeThursday, 28. January 2016, 02:20 hodinky 9 years ago
    I don't know about everyone, but I wrote the script you are referring to.

    The script itself doesn't have to be that big. I mostly added in various examples to show what could be done.

    Long story short. You would need a condition to determine if fullscreen or window mode is enabled. & you would need a value to define the selected resolution.

    P.S: resolution value only applies to window mode. auto or desktop is usually automatically applied to the resolution value regardless of what size is specified when running in fullscreen mode.

    P.P.S: If I remember correctly then all of the instructions should be on the wiki page. I don't remember if I added a template file to the resource section or not.

    Imperátor

    7285 Posts

  • #15, z MachtnixThursday, 28. January 2016, 19:31 hodinky 9 years ago
    My mistake... I use the wrong word, I want so say "jemand"... ;-)

    No, there isn't an example file yet, and yes, there are point-to-point instructions. Last night I tried to understand how it works, but I didn't. There is a variable called wm (windowed mode or not). What is this Conditions[cfg_update] for..?? If the player press the button to activate fullscreen before the game starts, the string should be "yes" else he want not, it's "no".

    Of course I can write "yes" or "no" into the config-file myself, before I upload the finale game. In this case I have only two variants, I don't need any resolution, it's only 800x600px.

    I do try and error now...

    Machtnix

    Kapitán

    1097 Posts

  • #16, z ke4Thursday, 28. January 2016, 20:56 hodinky 9 years ago
    I didn't study the script AFRLme wrote but if i understand it corectly ( that's how did it ) the whole point is to store informations outside of the engine because it remembers changes only after a save is loaded.

    So all i need is to write into file and read from it?
    I'm using string.match() e.g.

    if string.match(line, "Fullscreen") then
    if string.match(line, "yes") then
    else
    end
    end

    Zabiják klíčů

    810 Posts

  • #17, z sebastianThursday, 28. January 2016, 21:26 hodinky 9 years ago
    What i want is to get the actual Resolution of a resizable window (in realtime). Nothing to save here.

    Kapitán

    2346 Posts

  • #18, z afrlmeFriday, 29. January 2016, 00:26 hodinky 9 years ago
    haha... he was replying to machtnix question.

    I'm surprised Simon hasn't responded to this thread. I'll ask him the morrow about the resolution property. I've got bad memory so I don't remember what I did to access it as I tested it ages ago.

    Imperátor

    7285 Posts

  • #19, z MachtnixSunday, 31. January 2016, 18:18 hodinky 9 years ago
    Simple question: if the menu contains an option to make fullscreen or windowed (and if it really works ;-) the player has to restart the game to take over the changing? I think the script write something into the config-file and the engine has to read this first before starting, right?

    Kapitán

    1097 Posts

  • #20, z afrlmeSunday, 31. January 2016, 20:13 hodinky 9 years ago
    Technically it's possible to change window mode & window resolution during runtime. It's a bit buggy though at the minute.

    Imperátor

    7285 Posts