Skip to main content

PointerSystem

The PointerSystem is responsible for dispatching pointer events to entities that need them.

The PointerSystem can be optionally configured by the PointerComponent, by default Entities use the Collider's shape for pointer events.

Hierarchy

Index

Constructors

constructor

Properties

publicoverrideUseColliderShape

overrideUseColliderShape: boolean = false

Optionally override component configuration for all entities

publicoverrideUseGraphicsBounds

overrideUseGraphicsBounds: boolean = false

Optionally override component configuration for all entities

query

query: Query<typeof PointerComponent | typeof TransformComponent>

publicreadonlysystemType

systemType: Update = SystemType.Update

Determine whether the system is called in the SystemType.Update or the SystemType.Draw phase. Update is first, then Draw.

publicworld

world: World

staticpriority

priority: -5 = SystemPriority.Higher

System can execute in priority order, by default all systems are priority 0. Lower values indicated higher priority. For a system to execute before all other a lower priority value (-1 for example) must be set. For a system to execute after all other a higher priority value (10 for example) must be set.

Methods

publicinitialize

  • initialize(world: World, scene: Scene<unknown>): void
  • Optionally specify an initialize handler


    Parameters

    Returns void

optionalpostupdate

  • postupdate(scene: Scene<unknown>, elapsedMs: number): void
  • Optionally run a postupdate after the system processes matching entities


    Parameters

    • scene: Scene<unknown>
    • elapsedMs: number

      Time in milliseconds since the last frame

    Returns void

publicpreupdate

  • preupdate(): void
  • Optionally run a preupdate before the system processes matching entities


    Returns void

publicupdate

  • update(): void
  • Update all entities that match this system's types


    Returns void