| source |
|---|
Options for setting up and customizing visual feedback when players interact with the world in Focused Interaction mode on web and mobile clients.
export declare class FocusedInteraction Focused Interaction mode replaces on-screen controls on web and mobile clients with touch and mouse input that includes direct input access.
You can enable and disable Focused Interaction mode with the Player.enterFocusedInteractionMode() and Player.exitFocusedInteractionMode() methods.
When Focused Interaction mode is enabled, you can subscribe to the PlayerControls.onFocusedInteractionInputStarted, PlayerControls.onFocusedInteractionInputMoved, and PlayerControls.onFocusedInteractionInputEnded events.
For more information, see the Focused Interaction guide.
Creates a new FocusedInteraction instance.
Signature
constructor(player: Player);Parameters
player: Player
The player to assign to the focused interaction settings.
The current player.
Signature
protected readonly player: Player;Toggle and customize the visual feedback to display when players use tap input during Focused Interaction mode.
Signature
setTapOptions(isEnabled: boolean, tapOptions?: Partial<FocusedInteractionTapOptions>): void;Parameters
isEnabled: boolean
true to enable visual feedback for tap input; false to disable it.
tapOptions: Partial<FocusedInteractionTapOptions>
(Optional) The options to customize the tap visuals.
Returns
void
Toggle and customize visual feedback trails that are displayed when players use drag input during Focused Interaction mode.
Signature
setTrailOptions(isEnabled: boolean, trailOptions?: Partial<FocusedInteractionTrailOptions>): void;Parameters
isEnabled: boolean
true to enable trails; false to disable them.
trailOptions: Partial<FocusedInteractionTrailOptions>
(Optional) Options to customize trail visuals.
Returns
void