WorldPanelInputHandler

Input for a WorldSpace panel. The pointer position is a projection of the real cursor (or another ray) onto the panel surface, set each frame by SetPointer; buttons, wheel, keys and typed characters pass through from the engine Input facade so a hovered widget still clicks and a focused field still types.

Properties

CanvasScale

(float) { get; set } = 1f: Unused by world panels (they rasterise 1:1 with PanelSize); kept for the interface.

MousePosition

(Vector2)

MouseDelta

(Vector2)

PrevMousePosition

(Vector2)

MouseWheelDelta

(float)

IsAnyKeyDown

(bool)

Public Methods

SetPointer

public void SetPointer(Vector2? panelPixels)

Sets the pointer position in panel pixels for this frame, or clears it when the pointer is not over the panel.

Parameters:

  • panelPixels (Vector2?): Position in panel pixels, or null when the ray misses.

IsKeyDown

public bool IsKeyDown(KeyboardKey keyboardKey)

Parameters:

  • keyboardKey (KeyboardKey)

Returns: bool

IsKeyPressed

public bool IsKeyPressed(KeyboardKey keyboardKey)

Parameters:

  • keyboardKey (KeyboardKey)

Returns: bool

IsKeyUp

public bool IsKeyUp(KeyboardKey keyboardKey)

Parameters:

  • keyboardKey (KeyboardKey)

Returns: bool

IsMouseButtonDown

public bool IsMouseButtonDown(MouseButton button)

Parameters:

  • button (MouseButton)

Returns: bool

IsMouseButtonPressed

public bool IsMouseButtonPressed(MouseButton button)

Parameters:

  • button (MouseButton)

Returns: bool

IsMouseButtonUp

public bool IsMouseButtonUp(MouseButton button)

Parameters:

  • button (MouseButton)

Returns: bool

GetTypedCharacters

public string GetTypedCharacters()

Returns: string

GetClipboardText

public string GetClipboardText()

Returns: string

SetClipboardText

public void SetClipboardText(string text)

Parameters:

  • text (string)

SetTypedCharacters

public void SetTypedCharacters(string text)

Sets the characters typed this frame (for a focused world-panel text field).

Parameters:

  • text (string): The characters typed since the previous frame.

EndFrame

public void EndFrame()