The central system for starting and running the game.

Static variables

staticalign:String = GameAlign.TOP_LEFT

How to handle alignment of the game in the page. Note: Changes are applied in the next frame.

staticbackground:String

A color for the background of the game. Note: Only used if enabled at start.

staticfloodBackground:Bool = true

Whether or not to use the background color of the game for the whole page. Note: Not used if transparency is enabled.

staticread onlyheight:Int

Height of the game, in pixels.

staticimageSmoothingEnabled:Bool = true

Whether or not to use standard image smoothing when drawing. Note: Some older browsers might not allow disabling image smoothing.

staticread onlyloader:Loader = '???'

The main loader for assets needed for the game.

staticread onlypreloader:Loader = '???'

A loader for assets needed before the game starts loading, such as for loading screens.

staticread onlyroot:Sprite

The root sprite of the game.

staticscaleMode:String = ScaleMode.NEVER

How to handle resizing the game to fit in the page. Note: Changes are applied in the next frame.

staticread onlywidth:Int

Width of the game, in pixels.

staticonResize:Void ‑> Void

Callback for when the game is resized.

Static methods

static_addMouseQueue (s:Sprite):Void

Adds the specified sprite to the mouse queue, if applicable. Note: Do not call directly!

Parameters:

s

Sprite to add to the queue.

staticpageToGame (x:Float, y:Float):Point

Converts page coordinites to game space.

Parameters:

x

Position on the horizontal axis.

y

Position on the vertical axis.

staticstart (root:Sprite, width:Int, height:Int, background:String, transparent:Bool = false):Void

Sets up the page, render canvas, and starts the game loop.

Parameters:

root

Root sprite of the game.

width

Width of the game, in pixels.

height

Height of the game, in pixels.

background

An ARGB color for the background of the game.

transparent

Whether or not to use a transparent canvas.