Get window size

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

    game.WindowResolution.x
    game.WindowResolution.y
    

    Newbie

    24 Posts


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

    Imperator

    7278 Posts

  • #12, by sebastianTuesday, 26. January 2016, 13:08 8 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

    Thread Captain

    2346 Posts

  • #13, by MachtnixThursday, 28. January 2016, 00:18 8 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

    Thread Captain

    1097 Posts

  • #14, by afrlmeThursday, 28. January 2016, 02:20 8 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.

    Imperator

    7278 Posts

  • #15, by MachtnixThursday, 28. January 2016, 19:31 8 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

    Thread Captain

    1097 Posts

  • #16, by ke4Thursday, 28. January 2016, 20:56 8 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

    Key Killer

    810 Posts

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

    Thread Captain

    2346 Posts

  • #18, by afrlmeFriday, 29. January 2016, 00:26 8 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.

    Imperator

    7278 Posts

  • #19, by MachtnixSunday, 31. January 2016, 18:18 8 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?

    Thread Captain

    1097 Posts

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

    Imperator

    7278 Posts