Legacy:GetScreenWidth

From Spherical
Jump to: navigation, search

GetScreenWidth() returns the value in pixels of the current screen/game window width.

Usage

integer GetScreenWidth();


Examples

Abort("This game takes up " + GetScreenWidth() + " pixels of your screen.\n")

Aborts Sphere with the message of how wide the horizontal resolution of the game is.

var white = CreateColor(255,255,255);
Rectangle(0, 0, GetScreenWidth(), 25, white);

This draws a white rectangle over the top part of the screen, in full width and 25 pixels height.

Notes

If you don't configure your game, the screen width is 320 by default.

See also

API:Video/navbox