Particle is used in a ParticleEmitter

Hierarchy

  • ParticleImpl<this>
    • Particle

Constructors

Properties

acceleration: Vector = ...
active: boolean = true

Whether this entity is active, if set to false it will be reclaimed

beginColor: Color = Color.White
childrenAdded$: Util.Observable<Entity> = ...
childrenRemoved$: Util.Observable<Entity> = ...
componentAdded$: Util.Observable<AddedComponent> = ...

Observable that keeps track of component add or remove changes on the entity

componentRemoved$: Util.Observable<RemovedComponent> = ...
currentRotation: number = 0
elapsedMultiplier: number = 0
emitter: ParticleEmitter = null
endColor: Color = Color.White
endSize: number
eventDispatcher: EventDispatcher<any>

Direct access to the game object event dispatcher.

fadeFlag: boolean = false
focus: Vector = null
focusAccel: number = 0
id: number = ...

The unique identifier for the entity

isOffscreen: boolean = false
life: number = 300
opacity: number = 1
particleRotationalVelocity: number = 0
particleSize: number = 5
particleSprite: Sprite = null
position: Vector = ...
scene: Scene<unknown> = null

The scene that the entity is in, if any

sizeRate: number = 0
startSize: number
velocity: Vector = ...
visible: boolean = true

Accessors

  • get isInitialized(): boolean
  • Gets whether the actor is Initialized

    Returns boolean

  • get types(): string[]
  • The types of the components on the Entity

    Returns string[]

Methods

  • Internal

    Initializes this entity, meant to be called by the Scene before first update not by users of Excalibur.

    It is not recommended that internal excalibur methods be overridden, do so at your own risk.

    Parameters

    Returns void

  • Internal

    It is not recommended that internal excalibur methods be overridden, do so at your own risk.

    Internal _preupdate handler for onPostUpdate lifecycle event

    Parameters

    Returns void

  • Internal

    It is not recommended that internal excalibur methods be overridden, do so at your own risk.

    Internal _preupdate handler for onPreUpdate lifecycle event

    Parameters

    Returns void

  • Adds a component to the entity

    Type Parameters

    Parameters

    • component: T

      Component or Entity to add copy of components from

    • force: boolean = false

      Optionally overwrite any existing components of the same type

    Returns Entity

  • Adds a copy of all the components from another template entity as a "prefab"

    Parameters

    • templateEntity: Entity

      Entity to use as a template

    • force: boolean = false

      Force component replacement if it already exists on the target entity

    Returns Entity

  • Emits a new event

    Parameters

    • eventName: string

      Name of the event to emit

    • eventObject: any

      Data associated with this event

    Returns void

  • Returns a list of parent entities starting with the topmost parent. Includes the current entity.

    Returns Entity[]

  • Returns a list of all the entities that descend from this entity. Includes the current entity.

    Returns Entity[]

  • Check if a tag exists on the entity

    Parameters

    • tag: string

      name to check for

    Returns boolean

  • Returns void

  • Alias for removeEventListener. If only the eventName is specified it will remove all handlers registered for that specific event. If the eventName and the handler instance are specified only that handler will be removed.

    Parameters

    • eventName: string

      Name of the event to listen for

    • Optional handler: ((event: any) => void)

      Event handler for the thrown event

        • (event: any): void
        • Parameters

          • event: any

          Returns void

    Returns void

  • Alias for addEventListener. You can listen for a variety of events off of the engine; see the events section below for a complete list.

    Parameters

    • eventName: string

      Name of the event to listen for

    • handler: ((event: any) => void)

      Event handler for the thrown event

        • (event: any): void
        • Parameters

          • event: any

          Returns void

    Returns void

  • 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

    Returns void

  • Safe to override onPostUpdate lifecycle event handler. Synonymous with .on('postupdate', (evt) =>{...})

    onPostUpdate is called directly after an entity is updated.

    Parameters

    • _engine: Engine
    • _delta: number

    Returns void

  • Safe to override onPreUpdate lifecycle event handler. Synonymous with .on('preupdate', (evt) =>{...})

    onPreUpdate is called directly before an entity is updated.

    Parameters

    • _engine: Engine
    • _delta: number

    Returns void

  • Once listens to an event one time, then unsubscribes from that event

    Parameters

    • eventName: string

      The name of the event to subscribe to once

    • handler: ((event: any) => void)

      The handler of the event that will be auto unsubscribed

        • (event: any): void
        • Parameters

          • event: any

          Returns void

    Returns void

  • 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 immediately

    Type Parameters

    • ComponentOrType extends string | Component<string>

    Parameters

    • componentOrType: ComponentOrType
    • force: boolean = false

    Returns Entity

  • Removes a tag on the entity

    Removals are deferred until the end of update

    Parameters

    • tag: string
    • force: boolean = false

      Remove component immediately, no deferred

    Returns Entity

  • Unparents this entity, if there is a parent. Otherwise it does nothing.

    Returns void

  • Parameters

    • _engine: Engine
    • delta: number

    Returns void