Window

From MiniScript Wiki
Revision as of 16:22, 21 November 2021 by SebNozzi (talk | contribs) (Added caveat about screen-size when going full-screen in soda)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

In Soda, window is an intrinsic module which provides an interface to the game window.

Properties

Soda code may both get and set the following properties on the window module.

Property Meaning
window.width get/set the width of the window, in pixels
window.height get/set the height of the window, in pixels
window.fullScreen if true, game is in full-screen mode; if false, in window mode (where available)
window.backColor get/set background color of the window/screen

Usage Notes

Assigning a new value to window.width or window.height also switches out of full-screen mode (rather than attempting to change the resolution of the display).

Some platforms may not support the full-screen switch, and may (for example) always be in full-screen mode. In that case attempts to assign a different value to window.fullScreen, window.width, or window.height will simply be ignored.

Additionally, when switching to full-screen soda might resize the screen coordinates to a standard supported screen-size. For example, if your program starts in the non-standard 960x640 size when switching full-screen the screen size will probably be resized to the next supported screen-size, i.e. 1024x768.