Interface SpatialNavigationManager

interface SpatialNavigationManager {
    add(component): void;
    clear(): void;
    focus(component): void;
    getCandidates(): UiComponent[];
    getCurrent(): null | UiComponent;
    move(direction): void;
    pause(): void;
    refocus(): void;
    remove(component): void;
    resume(): void;
    start(): void;
    stop(): void;
}

Methods

  • Adds a new component to the focusable components list if it meets the focusability criteria.

    Parameters

    Returns void

  • Clears the list of focusable components.

    Returns void

  • Sets focus on a specific component if it is focusable, or finds a focusable child within it to focus on.

    Parameters

    Returns void

  • Retrieves the list of focusable components within the player.

    Returns UiComponent[]

  • Navigates to the next focusable component based on the specified direction.

    Parameters

    Returns void

  • Temporarily disables the Spatial Navigation functionality without removing the event listeners.

    Returns void

  • Focuses on the last focused component.

    Returns void

  • Removes a specified component from the focusable components list.

    Parameters

    Returns void

  • Re-enables the Spatial Navigation functionality after it has been paused.

    Returns void

  • Starts the Spatial Navigation system by adding keydown event listeners to the player.

    Returns void

  • Stops the Spatial Navigation by removing the keydown event listener from the player and updating the internal state.

    Returns void