SpatialPointerComponent


public final class SpatialPointerComponent implements Component


Component that modifies the pointer icon that is rendered on the component's Entity. If this Component is not present on an Entity the default, system-determined icon is used. Removing this Component will set the Entity's pointer back to the default icon.

Summary

Public methods

static final @NonNull SpatialPointerComponent

Creates a new SpatialPointerComponent.

final @NonNull SpatialPointerIcon

The SpatialPointerIcon that will be rendered on the component's Entity when the pointer is located on the entity.

boolean

Called by an Entity when it attempts to add this Component to itself.

void

Called by an Entity when it attempts to detach this Component from itself.

final void

The SpatialPointerIcon that will be rendered on the component's Entity when the pointer is located on the entity.

Public methods

create

Added in 1.0.0-alpha05
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-alpha05
public final @NonNull SpatialPointerIcon getSpatialPointerIcon()

The SpatialPointerIcon that will be rendered on the component's Entity when the pointer is located on the entity. A SpatialPointerIcon.DEFAULT value indicates the default pointer icon should be used.

onAttach

Added in 1.0.0-alpha05
public boolean onAttach(@NonNull Entity entity)

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
@NonNull 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

Added in 1.0.0-alpha05
public void onDetach(@NonNull Entity entity)

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
@NonNull Entity entity

Entity from which this Component was detached.

setSpatialPointerIcon

Added in 1.0.0-alpha05
public final void setSpatialPointerIcon(@NonNull SpatialPointerIcon spatialPointerIcon)

The SpatialPointerIcon that will be rendered on the component's Entity when the pointer is located on the entity. A SpatialPointerIcon.DEFAULT value indicates the default pointer icon should be used.