TorqueScript Reference
|
Functions | |
String | getDesktopResolution () |
String | getDisplayDeviceList () |
String | getRes () |
String | getResolutionList (devicename) |
String | getVideoDriverInfo () |
Boolean | isDeviceFullScreenOnly (devicename) |
Boolean | isFullScreen () |
void | minimizeWindow () |
Boolean | nextResolution () |
Boolean | prevResolution () |
void | restoreWindow () |
Boolean | setDisplayDevice (deviceName, [width]?, [height]?, [bpp]?, [fullScreen]?) |
Boolean | setRes (width, height, bpp) |
Boolean | setScreenMode (width, height, bpp, fullScreen) |
Boolean | setVerticalSync (enable) |
Boolean | switchBitDepth () |
Boolean | toggleFullScreen () |
void | videoSetGammaCorrection (gamma) |
Variables | |
Boolean | getVerticalSync |
String getDesktopResolution | ( | ) |
Use the getDesktopResolution function to determine the current resolution of the desktop (not the application). To get the current resolution of a windowed display of the torque game engine, simply examine the global variable '$pref::Video::resolution'.
String getDisplayDeviceList | ( | ) |
Use the getDisplayDeviceList function to get a list of valid display devices.
String getRes | ( | ) |
Get the width, height, and bitdepth of the screen.
String getResolutionList | ( | devicename | ) |
Use the getResolutionList function to get a semicolon separated list of legal resolutions for a specified device. Resolutions are always in the form: width height bpp, where width and height are in pixels and bpp is bits-per-pixel.
deviceName | A string containing a supported display device. |
String getVideoDriverInfo | ( | ) |
Use the getVideoDriverInfo function to dump information on the video driver to the console.
Boolean isDeviceFullScreenOnly | ( | devicename | ) |
Use the isDeviceFullScreenOnly function to determine if the device specified in devicename is for full screen display only, or whether it supports windowed mode too.
deviceName | A string containing a supported display device. |
Boolean isFullScreen | ( | ) |
Use the isFullScreen function to determine if the current application is displayed in full-screen mode.
void minimizeWindow | ( | ) |
Minimize the game window
Boolean nextResolution | ( | ) |
Use the nextResolution function to switch to the next valid (higher) resolution for the current display device.
Boolean prevResolution | ( | ) |
Use the prevResolution function to switch to the previous valid (lower) resolution for the current display device.
void restoreWindow | ( | ) |
Restore the game window
Boolean setDisplayDevice | ( | deviceName | , |
[width] ? | , | ||
[height] ? | , | ||
[bpp] ? | , | ||
[fullScreen] ? | |||
) |
Use the setDisplayDevice function to select a display device and to set the initial width, height and bits-per-pixel (bpp) setting, as well as whether the application is windowed or in fullScreen. If no resolution information is specified, the first legal resolution on this device's resolution list will be used. Furthermore, for each optional argument if the subsequent arguments are not specified, the first matching case will be used. Lastly, if the application is not told to display in full screen, but the device only supports windowed, the application will be forced into windowed mode.
deviceName | A supported display device name. |
width | Resolution width in pixels. |
height | Resolution height in pixels. |
bpp | Pixel resolution in bits-per-pixel (16 or 32). |
fullScreen | A boolean value. If set to true, the application displays in full- screen mode, otherwise it will attempt to display in windowed mode. |
Boolean setRes | ( | width | , |
height | , | ||
bpp | |||
) |
Use the setRes function to set the screen to the specified width, height, and bits-per-pixel (bpp).
width | Resolution width in pixels. |
height | Resolution height in pixels. |
bpp | Pixel resolution in bits-per-pixel (16 or 32). |
Boolean setScreenMode | ( | width | , |
height | , | ||
bpp | , | ||
fullScreen | |||
) |
Use the setScreenMode function to set the screen to the specified width, height, and bits-per-pixel (bpp). Additionally, if fullScreen is set to true the engine will attempt to display the application in full-screen mode, otherwise it will attempt to used windowed mode.
width | Resolution width in pixels. |
height | Resolution height in pixels. |
bpp | Pixel resolution in bits-per-pixel (16 or 32). |
fullScreen | A boolean value. If set to true, the application displays in full- screen mode, otherwise it will attempt to display in windowed mode. |
Boolean setVerticalSync | ( | enable | ) |
Use the setVerticalSync function to force the framerate to sync up with the vertical refresh rate. This is used to reduce excessive swapping/rendering. There is generally no purpose in rendering any faster than the monitor will support. Those extra 'ergs' can be used for something else
enable | A boolean value. If set to true, the engine will only swap front and back buffers on or before a vertical refresh pass. |
Boolean switchBitDepth | ( | ) |
Use the switchBitDepth function to toggle the bits-per-pixel (bpp) pixel resolution between 16 and 32.
Boolean toggleFullScreen | ( | ) |
Use the toggleFullScreen function to switch from full-screen mode to windowed, or vice versa.
void videoSetGammaCorrection | ( | gamma | ) |
Use the videoSetGammaCorrection function to adjust the gamma for the video card. The card will revert to it's default gamma setting as long as the application closes normally
gamma | A floating-point value between 0.0 and 1.0. |
Boolean getVerticalSync |
Use the getVerticalSync function to determine if the application's framerate is currently synchronized to the vertical refresh rate.