Scene
Defined in: display/Scene.ts:69
Interface for the Container class.
Extends
Section titled “Extends”Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Scene():
Scene
Defined in: display/Scene.ts:81
Returns
Section titled “Returns”Scene
Overrides
Section titled “Overrides”Properties
Section titled “Properties”add:
object
Defined in: mixins/factory/Factory.ts:6
animatedSprite()
Section titled “animatedSprite()”animatedSprite: (
props?
) =>AnimatedSprite
Parameters
Section titled “Parameters”props?
Section titled “props?”Partial
<AnimatedSpriteProps
>
Returns
Section titled “Returns”bitmapText()
Section titled “bitmapText()”bitmapText: (
props?
) =>BitmapText
Parameters
Section titled “Parameters”props?
Section titled “props?”Partial
<BitmapTextProps
>
Returns
Section titled “Returns”BitmapText
button()
Section titled “button()”button: (
props?
) =>Button
Parameters
Section titled “Parameters”props?
Section titled “props?”Partial
<ButtonProps
>
Returns
Section titled “Returns”container()
Section titled “container()”container: (
props?
) =>Container
Parameters
Section titled “Parameters”props?
Section titled “props?”Partial
<ContainerProps
>
Returns
Section titled “Returns”existing()
Section titled “existing()”existing: <
TEntity
>(entity
,props?
) =>TEntity
Type Parameters
Section titled “Type Parameters”TEntity
Section titled “TEntity”TEntity
Parameters
Section titled “Parameters”entity
Section titled “entity”TEntity
props?
Section titled “props?”Partial
<ExistingProps
>
Returns
Section titled “Returns”TEntity
flexContainer()
Section titled “flexContainer()”flexContainer: (
props?
) =>FlexContainer
Parameters
Section titled “Parameters”props?
Section titled “props?”Partial
<FlexContainerProps
>
Returns
Section titled “Returns”graphics()
Section titled “graphics()”graphics: (
props?
) =>Graphics
Parameters
Section titled “Parameters”props?
Section titled “props?”Partial
<GraphicsProps
>
Returns
Section titled “Returns”Graphics
htmlText()
Section titled “htmlText()”htmlText: (
props?
) =>HTMLText
Parameters
Section titled “Parameters”props?
Section titled “props?”Partial
<HTMLTextProps
>
Returns
Section titled “Returns”HTMLText
particleContainer()
Section titled “particleContainer()”particleContainer: (
props?
) =>ParticleContainer
Parameters
Section titled “Parameters”props?
Section titled “props?”Partial
<ParticleContainerProps
>
Returns
Section titled “Returns”spine()
Section titled “spine()”spine: (
props?
) =>Spine
Parameters
Section titled “Parameters”props?
Section titled “props?”Partial
<SpineProps
>
Returns
Section titled “Returns”spineAnimation()
Section titled “spineAnimation()”spineAnimation: <
ANames
>(props?
) =>SpineAnimation
<ANames
>
Type Parameters
Section titled “Type Parameters”ANames
Section titled “ANames”ANames
extends string
= string
Parameters
Section titled “Parameters”props?
Section titled “props?”Partial
<SpineProps
>
Returns
Section titled “Returns”SpineAnimation
<ANames
>
sprite()
Section titled “sprite()”sprite: (
props?
) =>Sprite
Parameters
Section titled “Parameters”props?
Section titled “props?”Partial
<SpriteProps
>
Returns
Section titled “Returns”Sprite
text()
Section titled “text()”text: (
props?
) =>Text
Parameters
Section titled “Parameters”props?
Section titled “props?”Partial
<TextProps
>
Returns
Section titled “Returns”Text
texture()
Section titled “texture()”texture: (
props?
) =>Texture
=resolveTexture
Parameters
Section titled “Parameters”props?
Section titled “props?”Partial
<TextureProps
>
Returns
Section titled “Returns”Texture
tilingSprite()
Section titled “tilingSprite()”tilingSprite: (
props?
) =>TilingSprite
Parameters
Section titled “Parameters”props?
Section titled “props?”Partial
<TilingSpriteProps
>
Returns
Section titled “Returns”TilingSprite
toaster()
Section titled “toaster()”toaster: (
toasterConfig?
,defaultToastConfig
) =>Toaster
Parameters
Section titled “Parameters”toasterConfig?
Section titled “toasterConfig?”Partial
<ToasterConfig
>
defaultToastConfig?
Section titled “defaultToastConfig?”Partial
<ToastConfig
> = {}
Returns
Section titled “Returns”uiCanvas()
Section titled “uiCanvas()”uiCanvas: (
props?
) =>UICanvas
Parameters
Section titled “Parameters”props?
Section titled “props?”Partial
<UICanvasFactoryProps
>
Returns
Section titled “Returns”svg(
props
):Svg
Parameters
Section titled “Parameters”WithRequiredProps
<SvgProps
, "ctx"
>
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”autoUnloadAssets
Section titled “autoUnloadAssets”autoUnloadAssets:
boolean
=false
Defined in: display/Scene.ts:71
Implementation of
Section titled “Implementation of”
readonly
id:string
Defined in: display/Scene.ts:70
Implementation of
Section titled “Implementation of”make:
object
Defined in: mixins/factory/Factory.ts:7
animatedSprite()
Section titled “animatedSprite()”animatedSprite: (
props?
) =>AnimatedSprite
Parameters
Section titled “Parameters”props?
Section titled “props?”Partial
<AnimatedSpriteProps
>
Returns
Section titled “Returns”bitmapText()
Section titled “bitmapText()”bitmapText: (
props?
) =>BitmapText
Parameters
Section titled “Parameters”props?
Section titled “props?”Partial
<BitmapTextProps
>
Returns
Section titled “Returns”BitmapText
button()
Section titled “button()”button: (
props?
) =>Button
Parameters
Section titled “Parameters”props?
Section titled “props?”Partial
<ButtonProps
>
Returns
Section titled “Returns”container()
Section titled “container()”container: (
props?
) =>Container
Parameters
Section titled “Parameters”props?
Section titled “props?”Partial
<ContainerProps
>
Returns
Section titled “Returns”existing()
Section titled “existing()”existing: <
TEntity
>(entity
,props?
) =>TEntity
Type Parameters
Section titled “Type Parameters”TEntity
Section titled “TEntity”TEntity
Parameters
Section titled “Parameters”entity
Section titled “entity”TEntity
props?
Section titled “props?”Partial
<ExistingProps
>
Returns
Section titled “Returns”TEntity
flexContainer()
Section titled “flexContainer()”flexContainer: (
props?
) =>FlexContainer
Parameters
Section titled “Parameters”props?
Section titled “props?”Partial
<FlexContainerProps
>
Returns
Section titled “Returns”graphics()
Section titled “graphics()”graphics: (
props?
) =>Graphics
Parameters
Section titled “Parameters”props?
Section titled “props?”Partial
<GraphicsProps
>
Returns
Section titled “Returns”Graphics
htmlText()
Section titled “htmlText()”htmlText: (
props?
) =>HTMLText
Parameters
Section titled “Parameters”props?
Section titled “props?”Partial
<HTMLTextProps
>
Returns
Section titled “Returns”HTMLText
particleContainer()
Section titled “particleContainer()”particleContainer: (
props?
) =>ParticleContainer
Parameters
Section titled “Parameters”props?
Section titled “props?”Partial
<ParticleContainerProps
>
Returns
Section titled “Returns”spine()
Section titled “spine()”spine: (
props?
) =>Spine
Parameters
Section titled “Parameters”props?
Section titled “props?”Partial
<SpineProps
>
Returns
Section titled “Returns”spineAnimation()
Section titled “spineAnimation()”spineAnimation: <
ANames
>(props?
) =>SpineAnimation
<ANames
>
Type Parameters
Section titled “Type Parameters”ANames
Section titled “ANames”ANames
extends string
= string
Parameters
Section titled “Parameters”props?
Section titled “props?”Partial
<SpineProps
>
Returns
Section titled “Returns”SpineAnimation
<ANames
>
sprite()
Section titled “sprite()”sprite: (
props?
) =>Sprite
Parameters
Section titled “Parameters”props?
Section titled “props?”Partial
<SpriteProps
>
Returns
Section titled “Returns”Sprite
text()
Section titled “text()”text: (
props?
) =>Text
Parameters
Section titled “Parameters”props?
Section titled “props?”Partial
<TextProps
>
Returns
Section titled “Returns”Text
texture()
Section titled “texture()”texture: (
props?
) =>Texture
=resolveTexture
Parameters
Section titled “Parameters”props?
Section titled “props?”Partial
<TextureProps
>
Returns
Section titled “Returns”Texture
tilingSprite()
Section titled “tilingSprite()”tilingSprite: (
props?
) =>TilingSprite
Parameters
Section titled “Parameters”props?
Section titled “props?”Partial
<TilingSpriteProps
>
Returns
Section titled “Returns”TilingSprite
toaster()
Section titled “toaster()”toaster: (
toasterConfig?
,defaultToastConfig
) =>Toaster
Parameters
Section titled “Parameters”toasterConfig?
Section titled “toasterConfig?”Partial
<ToasterConfig
>
defaultToastConfig?
Section titled “defaultToastConfig?”Partial
<ToastConfig
> = {}
Returns
Section titled “Returns”uiCanvas()
Section titled “uiCanvas()”uiCanvas: (
props?
) =>UICanvas
Parameters
Section titled “Parameters”props?
Section titled “props?”Partial
<UICanvasFactoryProps
>
Returns
Section titled “Returns”svg(
props
):Svg
Parameters
Section titled “Parameters”WithRequiredProps
<SvgProps
, "ctx"
>
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”onAnimationComplete
Section titled “onAnimationComplete”onAnimationComplete:
Signal
<(entity
) =>void
>
Defined in: mixins/animated.ts:37
Inherited from
Section titled “Inherited from”onAnimationStart
Section titled “onAnimationStart”onAnimationStart:
Signal
<(entity
) =>void
>
Defined in: mixins/animated.ts:35
Inherited from
Section titled “Inherited from”onAnimationUpdate
Section titled “onAnimationUpdate”onAnimationUpdate:
Signal
<(entity
) =>void
>
Defined in: mixins/animated.ts:36
Inherited from
Section titled “Inherited from”onDestroy
Section titled “onDestroy”onDestroy:
Signal
<() =>void
>
Defined in: display/Container.ts:65
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”signalConnections
Section titled “signalConnections”signalConnections:
SignalConnections
Defined in: mixins/signals.ts:9
Inherited from
Section titled “Inherited from”onGlobalChildAdded
Section titled “onGlobalChildAdded”
static
onGlobalChildAdded:Signal
<(child
) =>void
>
Defined in: display/Container.ts:79
Inherited from
Section titled “Inherited from”onGlobalChildRemoved
Section titled “onGlobalChildRemoved”
static
onGlobalChildRemoved:Signal
<(child
) =>void
>
Defined in: display/Container.ts:80
Inherited from
Section titled “Inherited from”Container
.onGlobalChildRemoved
Accessors
Section titled “Accessors”animationContext
Section titled “animationContext”Get Signature
Section titled “Get Signature”get animationContext():
string
Defined in: display/Scene.ts:74
Returns
Section titled “Returns”string
Set Signature
Section titled “Set Signature”set animationContext(
value
):void
Defined in: display/Scene.ts:77
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”Overrides
Section titled “Overrides”Get Signature
Section titled “Get Signature”get app():
Application
Defined in: display/Container.ts:93
Get the application instance.
Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”assets
Section titled “assets”Get Signature
Section titled “Get Signature”get assets():
SceneAssets
Defined in: display/Scene.ts:105
Returns
Section titled “Returns”Set Signature
Section titled “Set Signature”set assets(
value
):void
Defined in: display/Scene.ts:109
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”Methods
Section titled “Methods”addColoredBackground()
Section titled “addColoredBackground()”addColoredBackground(
colorOrConfig
,alpha
):Sprite
Defined in: display/Container.ts:113
Parameters
Section titled “Parameters”colorOrConfig
Section titled “colorOrConfig”number
| Partial
<BackgroundConfig
>
number
= 1
Returns
Section titled “Returns”Sprite
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”Container
.addColoredBackground
added()
Section titled “added()”added():
void
Defined in: display/Container.ts:172
This method is called when the container is added to the stage. It is meant to be overridden by subclasses.
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”addSignalConnection()
Section titled “addSignalConnection()”addSignalConnection(…
args
):void
Defined in: mixins/signals.ts:13
Parameters
Section titled “Parameters”…SignalConnection
[]
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”animate()
Section titled “animate()”animate(
animationProps
,instance?
):Tween
Defined in: mixins/animated.ts:39
Parameters
Section titled “Parameters”animationProps
Section titled “animationProps”instance?
Section titled “instance?”any
Returns
Section titled “Returns”Tween
Inherited from
Section titled “Inherited from”animateFrom()
Section titled “animateFrom()”animateFrom(
animationProps
,instance?
):Tween
Defined in: mixins/animated.ts:41
Parameters
Section titled “Parameters”animationProps
Section titled “animationProps”instance?
Section titled “instance?”any
Returns
Section titled “Returns”Tween
Inherited from
Section titled “Inherited from”animateFromTo()
Section titled “animateFromTo()”animateFromTo(
fromProps
,toProps
,instance?
):Tween
Defined in: mixins/animated.ts:43
Parameters
Section titled “Parameters”fromProps
Section titled “fromProps”toProps
Section titled “toProps”instance?
Section titled “instance?”any
Returns
Section titled “Returns”Tween
Inherited from
Section titled “Inherited from”animateSequence()
Section titled “animateSequence()”animateSequence(
sequences
,instance?
):Timeline
Defined in: mixins/animated.ts:49
Parameters
Section titled “Parameters”sequences
Section titled “sequences”instance?
Section titled “instance?”any
Returns
Section titled “Returns”Timeline
Inherited from
Section titled “Inherited from”bob(
config?
,instance?
):Tween
Defined in: mixins/animated.ts:66
Parameters
Section titled “Parameters”config?
Section titled “config?”duration?
Section titled “duration?”number
intensity?
Section titled “intensity?”number
instance?
Section titled “instance?”any
Returns
Section titled “Returns”Tween
Inherited from
Section titled “Inherited from”childAdded()
Section titled “childAdded()”childAdded(
child
):void
Defined in: display/Container.ts:174
Parameters
Section titled “Parameters”Container
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”childRemoved()
Section titled “childRemoved()”childRemoved(
child
):void
Defined in: display/Container.ts:189
Parameters
Section titled “Parameters”Container
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”connectAction()
Section titled “connectAction()”connectAction(…
args
):void
Defined in: mixins/signals.ts:15
Parameters
Section titled “Parameters”…SignalConnection
[]
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”connectSignal()
Section titled “connectSignal()”connectSignal(…
args
):void
Defined in: mixins/signals.ts:14
Parameters
Section titled “Parameters”…SignalConnection
[]
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”destroy()
Section titled “destroy()”destroy():
void
Defined in: display/Scene.ts:165
Removes all internal references and listeners as well as removes children from the display list.
Do not use a Container after calling destroy
.
Returns
Section titled “Returns”void
Example
Section titled “Example”container.destroy();container.destroy(true);container.destroy({ children: true });container.destroy({ children: true, texture: true, textureSource: true });
Implementation of
Section titled “Implementation of”Overrides
Section titled “Overrides”destroyAnimations()
Section titled “destroyAnimations()”destroyAnimations():
void
Defined in: mixins/animated.ts:55
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”enter()
Section titled “enter()”enter():
Promise
<any
>
Defined in: display/Scene.ts:127
Called to animate the scene in
Returns
Section titled “Returns”Promise
<any
>
Implementation of
Section titled “Implementation of”exit()
Section titled “exit()”exit():
Promise
<any
>
Defined in: display/Scene.ts:135
Called to animate the scene out
Returns
Section titled “Returns”Promise
<any
>
Implementation of
Section titled “Implementation of”initialize()
Section titled “initialize()”initialize():
void
|Promise
<void
>
Defined in: display/Scene.ts:119
Called to initialize the scene Called before the scene is added to the stage and before the scene is animated in
Returns
Section titled “Returns”void
| Promise
<void
>
Implementation of
Section titled “Implementation of”isAnimationPlaying()
Section titled “isAnimationPlaying()”isAnimationPlaying():
boolean
Defined in: mixins/animated.ts:59
Returns
Section titled “Returns”boolean
Inherited from
Section titled “Inherited from”onPause()
Section titled “onPause()”onPause(
config
):void
Defined in: display/Scene.ts:170
Parameters
Section titled “Parameters”config
Section titled “config”Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”onResume()
Section titled “onResume()”onResume(
config
):void
Defined in: display/Scene.ts:174
Parameters
Section titled “Parameters”config
Section titled “config”Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”pauseAnimations()
Section titled “pauseAnimations()”pauseAnimations():
void
Defined in: mixins/animated.ts:51
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”pulse()
Section titled “pulse()”pulse(
config?
,instance?
):Tween
Defined in: mixins/animated.ts:64
Parameters
Section titled “Parameters”config?
Section titled “config?”duration?
Section titled “duration?”number
intensity?
Section titled “intensity?”number
times?
Section titled “times?”number
instance?
Section titled “instance?”any
Returns
Section titled “Returns”Tween
Inherited from
Section titled “Inherited from”removed()
Section titled “removed()”removed():
void
Defined in: display/Container.ts:187
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”resize()
Section titled “resize()”resize(
size?
):void
Defined in: display/Scene.ts:161
Called when the window is resized
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”Overrides
Section titled “Overrides”resumeAnimations()
Section titled “resumeAnimations()”resumeAnimations():
void
Defined in: mixins/animated.ts:53
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”reverseAnimation()
Section titled “reverseAnimation()”reverseAnimation():
void
Defined in: mixins/animated.ts:57
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”shake()
Section titled “shake()”shake(
config?
,instance?
):Tween
Defined in: mixins/animated.ts:62
Parameters
Section titled “Parameters”config?
Section titled “config?”Partial
<ShakeConfig
>
instance?
Section titled “instance?”any
Returns
Section titled “Returns”Tween
Inherited from
Section titled “Inherited from”start()
Section titled “start()”start():
void
|Promise
<void
>
Defined in: display/Scene.ts:144
Called after the enter resolves If enter doesn’t return a promise, this is called immediately after enter
Returns
Section titled “Returns”void
| Promise
<void
>
Implementation of
Section titled “Implementation of”update()
Section titled “update()”update(
ticker?
):void
Defined in: display/Scene.ts:152
Called every frame
Parameters
Section titled “Parameters”ticker?
Section titled “ticker?”Ticker
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”Overrides
Section titled “Overrides”childAdded()
Section titled “childAdded()”
static
childAdded(child
):void
Defined in: display/Container.ts:82
Parameters
Section titled “Parameters”Container
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”childRemoved()
Section titled “childRemoved()”
static
childRemoved(child
):void
Defined in: display/Container.ts:86
Parameters
Section titled “Parameters”Container
Returns
Section titled “Returns”void