Get window size

  • #1, z sebastianWednesday, 20. January 2016, 08:40 hodinky 9 years ago
    Hello there folks!

    Is it possible to get the window size of the player when changing its dimensions (via lua) ?

    I know that there is a player command to set its size, but i want to get it and save this values inside a visionaire value

    Kind regards
    Sebastian

    Kapitán

    2346 Posts


  • #2, z afrlmeWednesday, 20. January 2016, 12:32 hodinky 9 years ago
    It's actually better to store this value inside of the config dot ini file - well if your plan is to have it automatically launch at the same size as it was when the game was last exited.

    There was a function for returning the current surface resolution... I'm not seeing it in the wiki for some reason & I can't remember it off the top of my head. Sorry.

    Imperátor

    7285 Posts

  • #3, z sebastianWednesday, 20. January 2016, 12:47 hodinky 9 years ago
    I already have this. What i had in mind is that depending on a REZIZABLE window do some stuff

    Kapitán

    2346 Posts

  • #4, z tristan-kangWednesday, 20. January 2016, 16:04 hodinky 9 years ago
    I already managed to save the values.

    Autosave is the hint. It's the thing never restored to initial values unless you delete it.

    Čestný člen

    267 Posts

  • #5, z sebastianWednesday, 20. January 2016, 16:34 hodinky 9 years ago
    Id like to get this values in realtime while resizing the window. Autosave doesnt seem to be a solution here...

    Kapitán

    2346 Posts

  • #6, z afrlmeWednesday, 20. January 2016, 17:17 hodinky 9 years ago
    I think the function was something along the lines of...
    getProperty("resolution").width -- width (might be .x instead of .width)
    getProperty("resolution").height -- height (might be .y instead of .height)
    

    I believe it was something along the lines of what I've added to the code block above. I don't however remember if it was .x/y or .width/height to return the values.

    Imperátor

    7285 Posts

  • #7, z sebastianWednesday, 20. January 2016, 17:43 hodinky 9 years ago
    Ill try asap. Thanks so far

    Kapitán

    2346 Posts

  • #8, z sebastianMonday, 25. January 2016, 13:35 hodinky 9 years ago
    sadly i cant get it to work with .width or .x.
    Regarding to the wiki http://wiki.visionaire-tracker.net/wiki/GetProperty there is no resolution property...

    Kapitán

    2346 Posts

  • #9, z afrlmeMonday, 25. January 2016, 15:28 hodinky 9 years ago
    Yeah according to the wiki, but it did exist - not sure it was ever added to the wiki, but there was a property field for resolution, as I vaguely remember testing it.

    Imperátor

    7285 Posts

  • #10, z sebastianMonday, 25. January 2016, 19:02 hodinky 9 years ago
    I hope one of the developers could solve this riddle for me razz

    Kapitán

    2346 Posts

  • #11, 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