Get window size

  • #1, by sebastianWednesday, 20. January 2016, 08:40 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

    Thread Captain

    2346 Posts


  • #2, by afrlmeWednesday, 20. January 2016, 12:32 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.

    Imperator

    7285 Posts

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

    Thread Captain

    2346 Posts

  • #4, by tristan-kangWednesday, 20. January 2016, 16:04 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.

    Great Poster

    267 Posts

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

    Thread Captain

    2346 Posts

  • #6, by afrlmeWednesday, 20. January 2016, 17:17 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.

    Imperator

    7285 Posts

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

    Thread Captain

    2346 Posts

  • #8, by sebastianMonday, 25. January 2016, 13:35 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...

    Thread Captain

    2346 Posts

  • #9, by afrlmeMonday, 25. January 2016, 15:28 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.

    Imperator

    7285 Posts

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

    Thread Captain

    2346 Posts

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

    game.WindowResolution.x
    game.WindowResolution.y
    

    Newbie

    24 Posts