PointerComponent
Hierarchy
- Component
- PointerComponent
Index
Constructors
Properties
Methods
Constructors
constructor
Parameters
optionaloptions: PointerComponentOptions
Returns PointerComponent
Properties
optionalreadonlydependencies
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
publicoptionallocalBounds
Optionally use other bounds for pointer testing
optionalowner
publicuseColliderShape
Use any existing Collider component geometry for pointer events. This is useful if you want
user pointer events only to trigger on the same collision geometry used in the collider component
for collision resolution. Default is true
.
publicuseGraphicsBounds
Use any existing Graphics component bounds for pointers. This is useful if you want the axis aligned
bounds around the graphic to trigger pointer events. Default is true
.
Methods
clone
Clones any properties on this component, if that property value has a
clone()
method it will be calledReturns Component
optionalonAdd
Optional callback called when a component is added to an entity
Parameters
owner: Entity<any>
Returns void
optionalonRemove
Optional callback called when a component is removed from an entity
Parameters
previousOwner: Entity<any>
Returns void
Add this component to optionally configure how the pointer system detects pointer events.
By default the collider shape is used and graphics bounds is not.
If both collider shape and graphics bounds are enabled it will fire events if either or are intersecting the pointer.