InteractionPolicy

class InteractionPolicy


Defines the interaction policy for a spatial object. This policy enables reacting to a user's spatial inputs.

Summary

Public companion functions

InteractionPolicy
clickable(isEnabled: Boolean, onClick: () -> Unit)

An InteractionPolicy that detects only click inputs

Public constructors

InteractionPolicy(
    isEnabled: Boolean,
    onInputEvent: (SpatialInputEvent) -> Unit
)

Public functions

open operator Boolean
equals(other: Any?)
open Int
open String

Public properties

Boolean

Whether an interaction policy is enabled for this object.

(SpatialInputEvent) -> Unit

Raw event executed with every input update.

Public companion functions

clickable

Added in 1.0.0-alpha09
fun clickable(isEnabled: Boolean = true, onClick: () -> Unit): InteractionPolicy

An InteractionPolicy that detects only click inputs

Parameters
isEnabled: Boolean = true

Whether an interaction policy is enabled for this object. If false, click events will not be returned.

onClick: () -> Unit

Executed after a click occurs.

Returns
InteractionPolicy

an InteractionPolicy that filters for click events.

Public constructors

InteractionPolicy

Added in 1.0.0-alpha09
InteractionPolicy(
    isEnabled: Boolean = true,
    onInputEvent: (SpatialInputEvent) -> Unit
)

Public functions

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

Public properties

isEnabled

Added in 1.0.0-alpha09
val isEnabledBoolean

Whether an interaction policy is enabled for this object. If false, spatial interaction input events will not returned.

onInputEvent

Added in 1.0.0-alpha09
val onInputEvent: (SpatialInputEvent) -> Unit

Raw event executed with every input update.