Login / Registrieren
DE EN FR ES IT CZ
Zurück Nach oben

Get window size

  • #1, by sebastian 10 years ago Zitieren
    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
  • #2, by afrlme 10 years ago Zitieren
    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.
  • #3, by sebastian 10 years ago Zitieren
    I already have this. What i had in mind is that depending on a REZIZABLE window do some stuff
  • #4, by tristan-kang 10 years ago Zitieren
    I already managed to save the values.

    Autosave is the hint. It's the thing never restored to initial values unless you delete it.
  • #5, by sebastian 10 years ago Zitieren
    Id like to get this values in realtime while resizing the window. Autosave doesnt seem to be a solution here...
  • #6, by afrlme 10 years ago Zitieren
    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.
  • #7, by sebastian 10 years ago Zitieren
    Ill try asap. Thanks so far
  • #8, by sebastian 10 years ago Zitieren
    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...
  • #9, by afrlme 10 years ago Zitieren
    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.
  • #10, by sebastian 10 years ago Zitieren
    I hope one of the developers could solve this riddle for me razz
  • #11, by HelixAbyss 10 years ago Zitieren
    Is this what you're looking for?

    game.WindowResolution.x
    game.WindowResolution.y