ParticleArgs
Hierarchy
- Partial<ParticleImpl>
- ParticleArgs
Index
Properties
- acceleration
- active
- beginColor
- children
- childrenAdded$
- childrenRemoved$
- componentAdded$
- componentRemoved$
- componentValues
- components
- currentRotation
- elapsedMultiplier
- emitter
- endColor
- endSize
- events
- fadeFlag
- focus
- focusAccel
- graphics
- id
- isInitialized
- isOffscreen
- life
- name
- opacity
- parent
- particleRotationalVelocity
- particleSize
- particleSprite
- position
- scene
- sizeRate
- startSize
- tagAdded$
- tagRemoved$
- tags
- transform
- types
- velocity
- visible
Methods
Properties
optionalacceleration
publicoptionalactive
publicoptionalbeginColor
children
publicoptionalchildrenAdded$
publicoptionalchildrenRemoved$
publicoptionalcomponentAdded$
publicoptionalcomponentRemoved$
publicoptionalcomponentValues
publicoptionalreadonlycomponents
Current components on the entity
Do not modify
Use addComponent/removeComponent otherwise the ECS will not be notified of changes.
optionalcurrentRotation
publicoptionalelapsedMultiplier
emitter
publicoptionalendColor
publicoptionalendSize
publicoptionalevents
Listen to or emit events for an entity
publicoptionalfadeFlag
publicoptionalfocus
publicoptionalfocusAccel
publicoptionalgraphics
publicoptionalid
The unique identifier for the entity
isInitialized
publicoptionalisOffscreen
publicoptionallife
publicoptionalname
publicoptionalopacity
parent
optionalparticleRotationalVelocity
optionalparticleSize
optionalparticleSprite
optionalposition
publicoptionalscene
The current scene that the entity is in, if any
publicoptionalsizeRate
publicoptionalstartSize
publicoptionaltagAdded$
publicoptionaltagRemoved$
tags
publicoptionaltransform
types
optionalvelocity
publicoptionalvisible
Methods
publicoptionaladdChild
publicoptionaladdComponent
publicoptionaladdTag
Adds a tag to an entity
Parameters
tag: string
Returns Entity<any>
publicoptionaladdTemplate
publicoptionalclearComponents
Returns void
publicoptionalclone
Creates a deep copy of the entity and a copy of all its components
Returns Entity<any>
publicoptionalemit
Type parameters
- TEventName: EventKey<EntityEvents>
Parameters
eventName: TEventName
event: EntityEvents[TEventName]
Returns void
optionalget
Type parameters
- TComponent: Component
Parameters
type: ComponentCtor<TComponent>
Returns MaybeKnownComponent<TComponent, any>
publicoptionalgetAncestors
Returns a list of parent entities starting with the topmost parent. Includes the current entity.
Returns Entity<any>[]
publicoptionalgetComponents
Returns all component instances on entity
Returns Component[]
publicoptionalgetDescendants
Returns a list of all the entities that descend from this entity. Includes the current entity.
Returns Entity<any>[]
publicoptionalhas
Check if a component type exists
Type parameters
- TComponent: Component
Parameters
type: ComponentCtor<TComponent>
Returns boolean
optionalhasAll
Verifies that an entity has all the required types
Type parameters
- TComponent: Component
Parameters
requiredTypes: ComponentCtor<TComponent>[]
Returns boolean
optionalhasAllTags
Verifies that an entity has all the required tags
Parameters
requiredTags: string[]
Returns boolean
publicoptionalhasTag
Check if a tag exists on the entity
Parameters
tag: string
name to check for
Returns boolean
publicoptionalisKilled
Returns boolean
publicoptionalkill
Returns void
publicoptionaloff
Type parameters
- TEventName: EventKey<EntityEvents>
Parameters
eventName: TEventName
handler: Handler<EntityEvents[TEventName]>
Returns void
publicoptionalon
Type parameters
- TEventName: EventKey<EntityEvents>
Parameters
eventName: TEventName
handler: Handler<EntityEvents[TEventName]>
Returns Subscription
publicoptionalonInitialize
onInitialize
is called before the first update of the entity. This method is meant to be overridden.Synonymous with the event handler
.on('initialize', (evt) => {...})
Parameters
engine: Engine<any>
Returns void
publicoptionalonPostUpdate
Safe to override onPostUpdate lifecycle event handler. Synonymous with
.on('postupdate', (evt) =>{...})
onPostUpdate
is called directly after an entity is updated.Parameters
engine: Engine<any>
delta: number
Returns void
publicoptionalonPreUpdate
Safe to override onPreUpdate lifecycle event handler. Synonymous with
.on('preupdate', (evt) =>{...})
onPreUpdate
is called directly before an entity is updated.Parameters
engine: Engine<any>
delta: number
Returns void
publicoptionalonce
Type parameters
- TEventName: EventKey<EntityEvents>
Parameters
eventName: TEventName
handler: Handler<EntityEvents[TEventName]>
Returns Subscription
publicoptionalremoveAllChildren
Removes all children from this entity
Returns Entity<any>
publicoptionalremoveChild
publicoptionalremoveComponent
Removes a component from the entity, by default removals are deferred to the end of entity update to avoid consistency issues
Components can be force removed with the
force
flag, the removal is not deferred and happens immediatelyType parameters
- TComponent: Component
Parameters
typeOrInstance: TComponent | ComponentCtor<TComponent>
force: boolean = false
Returns Entity<Exclude<any, TComponent>>
publicoptionalremoveTag
Removes a tag on the entity
Removals are deferred until the end of update
Parameters
tag: string
Returns Entity<any>
publicoptionalunparent
Unparents this entity, if there is a parent. Otherwise it does nothing.
Returns void
publicoptionalupdate
Parameters
engine: Engine<any>
delta: number
Returns void
Whether this entity is active, if set to false it will be reclaimed