Game > Screen


Screen Size

Set Screen Size

set screen size to w int h int

Change the width / height of the game screen. On Desktop, this will change the size of the window.

Config.stageWidth = [INT];
Config.stageHeight = [INT];
engine.reloadScreen();

Screen Size

screen width

Returns the game's screen width/height.

getScreenWidth()
getScreenHeight()

Window Size

Set Fullscreen State

set full screen enabled boolean

Enter or exit fullscreen. On some platforms, enter fullscreen must be in response to user input.

engine.setFullScreen([BOOLEAN]);

Is Game Fullscreen?

full screen enabled

Returns true if the game is currently in fullscreen mode.

engine.isInFullScreen()

Set Game Scale

set game scale to number

Set the window scale if playing in windowed mode.

Config.gameScale = [NUMBER];
engine.reloadScreen();

Game Scale

game scale

Returns the game scale which applies if playing in windowed mode.

Config.gameScale

Scale Mode

Set Scale Mode

set scale mode to int

Set the scaling mode used by the game in fullscreen mode.

Config.scaleMode = [INT];

Get Scale Mode

scale mode

Returns the scaling mode used by the game in fullscreen mode.

Config.scaleMode

Scale Mode Values

no scaling

Use this block with the set / get scale mode blocks.

ScaleMode.NO_SCALING
ScaleMode.FULLSCREEN
ScaleMode.STRETCH_TO_FIT
ScaleMode.SCALE_TO_FIT_LETTERBOX
ScaleMode.SCALE_TO_FIT_FILL
ScaleMode.SCALE_TO_FIT_FULLSCREEN

Current Scale

current scale

Returns the current scale of the game. Either 1, 1.5, 2, 3 or 4.

Engine.SCALE