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 |
final @NonNull SpatialPointerIcon |
The |
boolean |
Called by an |
void |
Called by an |
final void |
setSpatialPointerIcon(@NonNull SpatialPointerIcon spatialPointerIcon)The |
Public methods
create
public static final @NonNull SpatialPointerComponent create(@NonNull Session session)
Creates a new SpatialPointerComponent.
| Returns | |
|---|---|
@NonNull SpatialPointerComponent |
A new |
getSpatialPointerIcon
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
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.
| Returns | |
|---|---|
boolean |
True if the Component was attached to the given Entity. False if the Entity did not support having this Component attached. |
onDetach
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.
setSpatialPointerIcon
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.