PauseComponent
Hierarchy
- Component
- PauseComponent
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
Parameters
options: Partial<PauseComponentOptions> = {}
Returns PauseComponent
Properties
publiccanPause
Set to false to keep updating this entity while the scene is paused (for example menus or a HUD), default true
optionalreadonlyinheriteddependencies
Optionally list any component types this component depends on If the owner entity does not have these components, new components will be added to the entity
Only components with zero-arg constructors are supported as automatic component dependencies
inheritedowner
Accessors
publicisPaused
True while the owning scene is paused and this entity can be paused. Managed by the engine, read-only.
Returns boolean
Methods
inheritedclone
Clones any properties on this component, if that property value has a
clone()method it will be calledReturns Component
inheriteddeserialize
Parameters
data: Record<string, any>
Returns void
optionalinheritedonAdd
Optional callback called when a component is added to an entity
Parameters
owner: Entity
Returns void
optionalinheritedonRemove
Optional callback called when a component is removed from an entity
Parameters
previousOwner: Entity
Returns void
inheritedserialize
Returns Record<string, any>
inheritedtoJSON
Parameters
pretty: boolean = false
Returns string
Marks an entity as pausable and tracks whether it is currently paused.
When a scene is paused the
PauseSystemadds the PauseComponentTag to every entity withcanPause: true, and the systems that skip that tag (motion, collision, actions, ...) stop updating it.Most code should use Actor.canPause and Actor.isPaused instead of using this component directly.