Get window size

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

    2336 Posts


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

    6815 Posts

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

    Thread Captain

    2336 Posts

  • #4, by tristan-kangWednesday, 20. January 2016, 16:04 4 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 4 years ago
    Id like to get this values in realtime while resizing the window. Autosave doesnt seem to be a solution here...

    Thread Captain

    2336 Posts

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

    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

    6815 Posts

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

    Thread Captain

    2336 Posts

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

    2336 Posts

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

    6815 Posts

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

    Thread Captain

    2336 Posts

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

    game.WindowResolution.x
    game.WindowResolution.y
    1
    2
    3

    Newbie

    24 Posts

Write post