PointerCaptureComponent


class PointerCaptureComponent : Component


Provides pointer capture capabilities for a given entity.

To enable pointer capture, the task must be in full space, and the entity must be visible.

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

Listener for pointer capture state changes.

Constants

const Int

Pointer Capture is disabled for this component.

const Int

Pointer Capture is enabled for this component.

const Int

Pointer Capture has been stopped for this component.

Public companion functions

PointerCaptureComponent
create(
    session: Session,
    executor: Executor,
    stateListener: PointerCaptureComponent.StateListener,
    inputListener: InputEventListener
)

Factory function for creating PointerCaptureComponent instances.

Public functions

open Boolean
onAttach(entity: Entity)

Called when this component is attached to the entity.

open Unit
onDetach(entity: Entity)

Called when this component is detached from the entity.

Constants

POINTER_CAPTURE_STATE_ACTIVE

const val POINTER_CAPTURE_STATE_ACTIVE = 1: Int

Pointer Capture is disabled for this component.

POINTER_CAPTURE_STATE_PAUSED

const val POINTER_CAPTURE_STATE_PAUSED = 0: Int

Pointer Capture is enabled for this component.

POINTER_CAPTURE_STATE_STOPPED

const val POINTER_CAPTURE_STATE_STOPPED = 2: Int

Pointer Capture has been stopped for this component.

Public companion functions

create

Added in 1.0.0-alpha01
fun create(
    session: Session,
    executor: Executor,
    stateListener: PointerCaptureComponent.StateListener,
    inputListener: InputEventListener
): PointerCaptureComponent

Factory function for creating PointerCaptureComponent instances.

Public functions

onAttach

Added in 1.0.0-alpha01
open fun onAttach(entity: Entity): Boolean

Called when this component is attached to the entity.

Parameters
entity: Entity

Entity this component is being attached to.

Returns
Boolean

True if the component can attach to given Entity.

onDetach

Added in 1.0.0-alpha01
open fun onDetach(entity: Entity): Unit

Called when this component is detached from the entity.

Parameters
entity: Entity

Entity this component is being detached from.