Container
Defined in: display/Container.ts:62
The Container class extends the _Container class (which includes the Animated and Factory mixins) and implements the IContainer interface. It represents a container for PIXI.js display objects.
Extends
Section titled “Extends”IFactory
<{animatedSprite
: (props?
) =>AnimatedSprite
;bitmapText
: (props?
) =>BitmapText
;button
: (props?
) =>Button
;container
: (props?
) =>Container
;existing
: <TEntity
>(entity
,props?
) =>TEntity
;flexContainer
: (props?
) =>FlexContainer
;graphics
: (props?
) =>Graphics
;htmlText
: (props?
) =>HTMLText
;particleContainer
: (props?
) =>ParticleContainer
;spine
: (props?
) =>Spine
;spineAnimation
: <ANames
>(props?
) =>SpineAnimation
<ANames
>;sprite
: (props?
) =>Sprite
;text
: (props?
) =>Text
;texture
: (props?
) =>Texture
;tilingSprite
: (props?
) =>TilingSprite
;toaster
: (toasterConfig?
,defaultToastConfig
) =>Toaster
;uiCanvas
: (props?
) =>UICanvas
;svg
:Svg
; },this
> &ISignalContainer
&IAnimated
Extended by
Section titled “Extended by”Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Container(
config
):Container
Defined in: display/Container.ts:101
The constructor for the Container class.
Parameters
Section titled “Parameters”config
Section titled “config”Partial
<ContainerConfig
> = {}
The configuration for the container.
Returns
Section titled “Returns”Container
Overrides
Section titled “Overrides”Animated(WithSignals(Factory())).constructor
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”Container
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”Animated(WithSignals(Factory())).add
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”Container
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”Animated(WithSignals(Factory())).make
onAnimationComplete
Section titled “onAnimationComplete”onAnimationComplete:
Signal
<(entity
) =>void
>
Defined in: mixins/animated.ts:37
Inherited from
Section titled “Inherited from”Animated(WithSignals(Factory())).onAnimationComplete
onAnimationStart
Section titled “onAnimationStart”onAnimationStart:
Signal
<(entity
) =>void
>
Defined in: mixins/animated.ts:35
Inherited from
Section titled “Inherited from”Animated(WithSignals(Factory())).onAnimationStart
onAnimationUpdate
Section titled “onAnimationUpdate”onAnimationUpdate:
Signal
<(entity
) =>void
>
Defined in: mixins/animated.ts:36
Inherited from
Section titled “Inherited from”Animated(WithSignals(Factory())).onAnimationUpdate
onDestroy
Section titled “onDestroy”onDestroy:
Signal
<() =>void
>
Defined in: display/Container.ts:65
Implementation of
Section titled “Implementation of”signalConnections
Section titled “signalConnections”signalConnections:
SignalConnections
Defined in: mixins/signals.ts:9
Inherited from
Section titled “Inherited from”Animated(WithSignals(Factory())).signalConnections
onGlobalChildAdded
Section titled “onGlobalChildAdded”
static
onGlobalChildAdded:Signal
<(child
) =>void
>
Defined in: display/Container.ts:79
onGlobalChildRemoved
Section titled “onGlobalChildRemoved”
static
onGlobalChildRemoved:Signal
<(child
) =>void
>
Defined in: display/Container.ts:80
Accessors
Section titled “Accessors”animationContext
Section titled “animationContext”Get Signature
Section titled “Get Signature”get animationContext():
undefined
|string
Defined in: display/Container.ts:70
Returns
Section titled “Returns”undefined
| string
Set Signature
Section titled “Set Signature”set animationContext(
value
):void
Defined in: display/Container.ts:73
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”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”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”IContainer
.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”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”Animated(WithSignals(Factory())).addSignalConnection
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”Animated(WithSignals(Factory())).animate
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”Animated(WithSignals(Factory())).animateFrom
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”Animated(WithSignals(Factory())).animateFromTo
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”Animated(WithSignals(Factory())).animateSequence
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”Animated(WithSignals(Factory())).bob
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”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”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”Animated(WithSignals(Factory())).connectAction
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”Animated(WithSignals(Factory())).connectSignal
destroy()
Section titled “destroy()”destroy(
options?
):void
Defined in: display/Container.ts:178
Removes all internal references and listeners as well as removes children from the display list.
Do not use a Container after calling destroy
.
Parameters
Section titled “Parameters”options?
Section titled “options?”DestroyOptions
Options parameter. A boolean will act as if all options have been set to that value
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”Animated(WithSignals(Factory())).destroy
destroyAnimations()
Section titled “destroyAnimations()”destroyAnimations():
void
Defined in: mixins/animated.ts:55
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”Animated(WithSignals(Factory())).destroyAnimations
isAnimationPlaying()
Section titled “isAnimationPlaying()”isAnimationPlaying():
boolean
Defined in: mixins/animated.ts:59
Returns
Section titled “Returns”boolean
Inherited from
Section titled “Inherited from”Animated(WithSignals(Factory())).isAnimationPlaying
pauseAnimations()
Section titled “pauseAnimations()”pauseAnimations():
void
Defined in: mixins/animated.ts:51
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”Animated(WithSignals(Factory())).pauseAnimations
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”Animated(WithSignals(Factory())).pulse
removed()
Section titled “removed()”removed():
void
Defined in: display/Container.ts:187
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”resize()
Section titled “resize()”resize(
size?
):void
Defined in: display/Container.ts:165
Resize the container. This method is meant to be overridden by subclasses.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”resumeAnimations()
Section titled “resumeAnimations()”resumeAnimations():
void
Defined in: mixins/animated.ts:53
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”Animated(WithSignals(Factory())).resumeAnimations
reverseAnimation()
Section titled “reverseAnimation()”reverseAnimation():
void
Defined in: mixins/animated.ts:57
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”Animated(WithSignals(Factory())).reverseAnimation
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”Animated(WithSignals(Factory())).shake
update()
Section titled “update()”update(
ticker?
):void
Defined in: display/Container.ts:157
Update the container. This method is meant to be overridden by subclasses.
Parameters
Section titled “Parameters”ticker?
Section titled “ticker?”number
| Ticker
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”childAdded()
Section titled “childAdded()”
static
childAdded(child
):void
Defined in: display/Container.ts:82
Parameters
Section titled “Parameters”Container
Returns
Section titled “Returns”void
childRemoved()
Section titled “childRemoved()”
static
childRemoved(child
):void
Defined in: display/Container.ts:86
Parameters
Section titled “Parameters”Container
Returns
Section titled “Returns”void