PointerCaptureComponent
class PointerCaptureComponent : Component
Provides pointer capture capabilities for a given Entity.
To enable pointer capture, the task must be in full space, the entity must be visible, and the PointerCaptureComponent must be attached to the entity.
Only one PointerCaptureComponent can be attached to an entity at a given time. If a second one tries to attach to an entity, it will fail.
Summary
Nested types |
|---|
|
Defines the possible states of a |
Public companion functions |
|
|---|---|
PointerCaptureComponent |
create(Creates a new instance of |
Public functions |
|
|---|---|
open Boolean |
Called by an |
open Unit |
Called by an |
Public companion functions
create
fun create(
session: Session,
executor: Executor,
stateListener: Consumer<PointerCaptureComponent.PointerCaptureState>,
inputListener: Consumer<InputEvent>
): PointerCaptureComponent
Creates a new instance of PointerCaptureComponent.
| Parameters | |
|---|---|
session: Session |
The active |
executor: Executor |
The |
stateListener: Consumer<PointerCaptureComponent.PointerCaptureState> |
A |
inputListener: Consumer<InputEvent> |
A |
| Returns | |
|---|---|
PointerCaptureComponent |
A new instance of |
Public functions
onAttach
open fun onAttach(entity: Entity): Boolean
Called by an Entity when it attempts to add this Component to itself.
This method is restricted because it is only called from Entity.addComponent.
| Parameters | |
|---|---|
entity: Entity |
Entity to which this Component was attached. |
| Returns | |
|---|---|
Boolean |
True if the Component was attached to the given Entity. False if the Entity did not support having this Component attached. |
onDetach
open fun onDetach(entity: Entity): Unit
Called by an Entity when it attempts to detach this Component from itself.
This method is restricted because it is only called from Entity.removeComponent.
| Parameters | |
|---|---|
entity: Entity |
Entity from which this Component was detached. |