Class: Game

SINT.Game

new SINT.Game (config)

Name Type Description
config object optional

The Game options

Name Type Default Description
domElement HTMLElement optional

HTML Element

initWidth number 750 optional

The Game width

initHeight number 1334 optional

The Game height

showFPS boolean true optional
autoResize boolean true optional

is autoResize the view

backgroundColor number 0x000000 optional

The backgroundColor

Extends

Members

_options object protected inherited overrides

The default options, so we mixin functionality later.

initHeight number

The initHeight.

initWidth number

The initWidth.

Loader instance to help with asset loading.

WebGL renderer if available, otherwise CanvasRenderer

Reference to the renderer's screen rectangle. Its safe to use as filterArea or hitArea for whole screen

The root display container that's rendered.

Ticker for doing render updates.

Default Value:
  • SINT.ticker.shared

view HTMLCanvasElement readonly inherited overrides

Reference to the renderer's canvas element.

Methods

add (child)PIXI.DisplayObject

Adds one or more children to the stage.

Name Type Description
child PIXI.DisplayObject repeatable

The DisplayObject(s) to add to the container

Returns:
Type Description
PIXI.DisplayObject The first child that was added.

destroy (removeView, stageOptions) inherited overrides

Destroy and don't use after this.

Name Type Default Description
removeView Boolean false optional

Automatically remove canvas from DOM.

stageOptions object | boolean optional

Options parameter. A boolean will act as if all options have been set to that value

Name Type Default Description
children boolean false optional

if set to true, all the children will have their destroy method called as well. 'stageOptions' will be passed on to those calls.

texture boolean false optional

Only used for child Sprites if stageOptions.children is set to true. Should it destroy the texture of the child sprite

baseTexture boolean false optional

Only used for child Sprites if stageOptions.children is set to true. Should it destroy the base texture of the child sprite

preload (config)

Init assets loader

Name Type Description
config object

The assets loader options

Name Type Default Description
assets object {} optional

The assets

loading function ()=>{} optional

loading function

loaded function ()=>{} optional

loaded callback function

remove (child)

Remove child from stage.

Name Type Description
child PIXI.DisplayObject repeatable

The DisplayObject(s) to add to the container

removeThis ()

Destroy and don't use after this.

render () inherited overrides

Render the current stage.

start () inherited overrides

Convenience method for starting the render.

Convenience method for stopping the render.