GLBasic User Manual

Main sections

GETSCREENSIZE

GETSCREENSIZE sx##, sy##



Returns the screen resolution for your project (as specified in project options) and places it in the variables sx## and sy##. You can use this information to scale graphics for different platforms (e.g. you could use different sized sprites based on what GETSCREENSIZE returns, or you could use zoom sprite to resize your sprites as necessary for various displays).

For console programs, GETSCREENSIZE tries to find the number of visible columns and rows of the console window. If it is unable to determine the size of the console window it will default to 80 x 40.

// GETSCREENSIZE

GETSCREENSIZE sx, sy
PRINT "Screen: "+sx + " : " + sy, 0,0
SHOWSCREEN
MOUSEWAIT

See also...