Screen API
From TargetWiki
The screen API controls the window that Targetware runs in, whether it's fullscreen or windowed.
- screen.width()
- This returns the width in pixels of the window.
- screen.height()
- This returns the height in pixels of the window.
- screen.depth()
- This returns the bit depth of the window, which is usually either 16 or 32.
- screen.fullscreen()
- This returns true for a fullscreen window, or false for a normal window.
- screen.multisample()
- This returns the multisample, or anti-aliasing, level of the window. For no anti-aliasing, 1 is returned. For 2xAA, 4xAA, 8xAA, etc., the number returned is the prefix, i.e. 2, 4, or 8 respectively.
- screen.modecount()
- This returns the number of supported fullscreen display modes.
- screen.mode( <number> )
- The argument should be between 1 and the mode count. This returns four values: the width, the height, the bit depth, and the refresh rate of the specified mode.
- screen.setmode( <width>, <height>, <depth>, <refresh>, <multisample>, <fullscreen> )
- All of the arguments are numbers, except for fullscreen, which is a boolean. If the screen cannot be set to the specified mode values, the screen will stay the same and this will return false. Otherwise, the screen will change right away, and this will return false.
- screen.gamma()
- This returns what Targetware thinks is the gamma value of the screen. Many graphics drivers now prevent applications from getting or setting the gamma value correctly, so this value may not be entirely correct.
- screen.setgamma( <number> )
- This sets the gamma value of the screen. As stated above, many graphics drivers now prevent applications from controlling the gamma, so this may not work entirely as expected.
- screen.fps()
- This returns the current frames per second performance. This value is updated approximately once per second.
- screen.redraw()
- This causes the screen to redraw immediately. This is normally not used, since the screen will redraw as fast as possible anyway. However, for things like displaying a splash screen while a script does other work, this can be useful.
