SpatialPointerComponent


public final class SpatialPointerComponent implements Component


Component that modifies the pointer icon. Adding or removing this component sets the entity's pointer to use the default, system-determined icon.

Summary

Public methods

static final @NonNull SpatialPointerComponent

Creates a new SpatialPointerComponent.

final SpatialPointerIcon

The SpatialPointerIcon that will be rendered on the component's entity.

boolean

Called when this component is attached to the entity.

void

Called when this component is detached from the entity.

final void

The SpatialPointerIcon that will be rendered on the component's entity.

Public methods

create

Added in 1.0.0-alpha04
public static final @NonNull SpatialPointerComponent create(@NonNull Session session)

Creates a new SpatialPointerComponent.

Parameters
@NonNull Session session

The session to use for creating the component.

getSpatialPointerIcon

Added in 1.0.0-alpha04
public final SpatialPointerIcon getSpatialPointerIcon()

The SpatialPointerIcon that will be rendered on the component's entity. A null value indicates the default pointer icon should be used.

onAttach

public boolean onAttach(@NonNull Entity entity)

Called when this component is attached to the entity.

Parameters
@NonNull Entity entity

Entity this component is being attached to.

Returns
boolean

True if the component can attach to given Entity.

onDetach

public void onDetach(@NonNull Entity entity)

Called when this component is detached from the entity.

Parameters
@NonNull Entity entity

Entity this component is being detached from.

setSpatialPointerIcon

Added in 1.0.0-alpha04
public final void setSpatialPointerIcon(SpatialPointerIcon spatialPointerIcon)

The SpatialPointerIcon that will be rendered on the component's entity. A null value indicates the default pointer icon should be used.