Windowed mode cropping scene backgrounds

  • #1, by jeffTuesday, 21. August 2018, 18:09 6 years ago
    My game is HD for larger displays, but I need it to also run in a smaller "windowed mode", if necessary. When I tested fullscreen=no, and changed resolution from 1920x1080 to 1280x720 in the Build menu, the movies were scaled but the background scene images were extending off the right and bottom screen.

    How can I offer smaller windowed mode for users that would scale (UP or DOWN) the scene graphics?

    Newbie

    17 Posts


  • #2, by sebastianTuesday, 21. August 2018, 19:28 6 years ago
    Hello Jeff,

    The resolution you set in your game settings determinde the base resolution of your game.
    Scenes which are larger will get scrolled, scenes which are smaller will render black at the left "free" space.

    So to achieve a windowmode for your 1920x1080 Pixel game resolution, you dont need to change this base resolution. You need to switch to window-mode and resize that window.

    To toggle between fullscreen and window mode there are two ways:

    Keyboard: ALT+Enter
    via Luascript: toggleWindowMode()

    to set the window size:
    via Luascript: setWindowSize({x=1280,y=720})

    These both scripts can be used inside an "Execute a script" action part.

    Note that details in your backgrounds get lost, when you resize your game to a smaller resolution than intended by the game settings.

    When you want to remember if your game should start in wondow or fullscreen mode, you need to create a script, which fills the resolution/window settings into your config.ini file
    There is an (old) example in the wiki for that: https://wiki.visionaire-tracker.net/wiki/Read/Write_Config.ini_(CMS)
    (forum destroys the link. Copy it with the (CMS) included)

    kind regards
    Sebastian

    Thread Captain

    2346 Posts

  • #3, by jeffTuesday, 21. August 2018, 22:27 6 years ago
    So to achieve a windowmode for your 1920x1080 Pixel game resolution, you dont need to change this base resolution. You need to switch to window-mode and resize that window.

    To toggle between fullscreen and window mode there are two ways:

    Keyboard: ALT+Enter
    via Luascript: toggleWindowMode()

    to set the window size:
    via Luascript: setWindowSize({x=1280,y=720})

    These both scripts can be used inside an "Execute a script" action part.

    Thank you so much, Sebastian! You have been very helpful smile I will try to implement that.

    Newbie

    17 Posts