![]() |
Gondwana Game Engine Development (master) - 2.6.1
Gondwana is a cross-platform 2.5D game and rendering engine written in C#/.NET 8. It provides fine-grained control over rendering, timing, and scene composition, with built-in support for parallax, z-ordering, pixel overhang, collision detection, and particle effects. Gondwana targets desktop and web platforms using SkiaSharp for graphics and pluggable audio backends for desktop and browser targets.
|
Routes mouse, touch, and keyboard input to registered widgets for a render surface host. More...
Public Member Functions | |
| WidgetInputRouter (RenderSurfaceHostBase renderSurfaceHost, KeyboardEventPoller? keyboardEventPoller, MouseEventPoller? mouseEventPoller, TouchEventPoller? touchEventPoller) | |
| Initializes a new instance of the WidgetInputRouter class. | |
| void | Register (WidgetBase widget) |
| Registers a widget so that it can receive routed input. | |
| void | Unregister (WidgetBase widget) |
| Unregisters a widget so that it no longer receives routed input. | |
| void | BringToFront (WidgetBase widget) |
| Moves a registered widget to the front of the input routing order. | |
| void | Focus (WidgetBase? widget) |
| Assigns keyboard focus to the specified widget. | |
| void | ClearFocus () |
| Clears the current keyboard focus. | |
| void | Start () |
| Starts routing input events from the configured pollers to registered widgets. | |
| void | Stop () |
| Stops routing input events and releases current pointer and focus state. | |
| void | Dispose () |
| Releases the resources used by the router and unregisters all widgets. | |
Static Public Attributes | |
| const int | MousePointerId = -1 |
| Identifies mouse pointer events in routed widget input. | |
Properties | |
| WidgetBase? | FocusedWidget [get] |
| Gets the widget that currently has keyboard focus. | |
Events | |
| Action< PrimaryPointerActionEventArgs >? | UnhandledPrimaryAction |
| Occurs when a primary gameplay action was not claimed by a widget. Mouse left-button presses fire on press; touch fires only for a recognized single-finger tap whose contact began outside widgets. | |
Routes mouse, touch, and keyboard input to registered widgets for a render surface host.
Definition at line 16 of file WidgetInputRouter.cs.
| Gondwana.Widgets.WidgetInputRouter.WidgetInputRouter | ( | RenderSurfaceHostBase | renderSurfaceHost, |
| KeyboardEventPoller? | keyboardEventPoller, | ||
| MouseEventPoller? | mouseEventPoller, | ||
| TouchEventPoller? | touchEventPoller ) |
Initializes a new instance of the WidgetInputRouter class.
| renderSurfaceHost | The render surface host whose widgets will receive routed input. |
| keyboardEventPoller | The keyboard event poller that supplies keyboard input, or null. |
| mouseEventPoller | The mouse event poller that supplies mouse input, or null. |
| touchEventPoller | The touch event poller that supplies touch input, or null. |
Definition at line 55 of file WidgetInputRouter.cs.
| void Gondwana.Widgets.WidgetInputRouter.BringToFront | ( | WidgetBase | widget | ) |
Moves a registered widget to the front of the input routing order.
| widget | The widget to move to the front. |
Definition at line 124 of file WidgetInputRouter.cs.
| void Gondwana.Widgets.WidgetInputRouter.ClearFocus | ( | ) |
Clears the current keyboard focus.
Definition at line 160 of file WidgetInputRouter.cs.
| void Gondwana.Widgets.WidgetInputRouter.Dispose | ( | ) |
Releases the resources used by the router and unregisters all widgets.
Definition at line 235 of file WidgetInputRouter.cs.
| void Gondwana.Widgets.WidgetInputRouter.Focus | ( | WidgetBase? | widget | ) |
Assigns keyboard focus to the specified widget.
| widget | The widget to focus, or null to clear focus. |
Definition at line 142 of file WidgetInputRouter.cs.
| void Gondwana.Widgets.WidgetInputRouter.Register | ( | WidgetBase | widget | ) |
Registers a widget so that it can receive routed input.
| widget | The widget to register. |
Definition at line 90 of file WidgetInputRouter.cs.
| void Gondwana.Widgets.WidgetInputRouter.Start | ( | ) |
Starts routing input events from the configured pollers to registered widgets.
Definition at line 168 of file WidgetInputRouter.cs.
| void Gondwana.Widgets.WidgetInputRouter.Stop | ( | ) |
Stops routing input events and releases current pointer and focus state.
Definition at line 199 of file WidgetInputRouter.cs.
| void Gondwana.Widgets.WidgetInputRouter.Unregister | ( | WidgetBase | widget | ) |
Unregisters a widget so that it no longer receives routed input.
| widget | The widget to unregister. |
Definition at line 114 of file WidgetInputRouter.cs.
|
static |
Identifies mouse pointer events in routed widget input.
Definition at line 21 of file WidgetInputRouter.cs.
|
get |
Gets the widget that currently has keyboard focus.
The focused widget, or null if no widget currently has focus.
Definition at line 73 of file WidgetInputRouter.cs.
| Action<PrimaryPointerActionEventArgs>? Gondwana.Widgets.WidgetInputRouter.UnhandledPrimaryAction |
Occurs when a primary gameplay action was not claimed by a widget. Mouse left-button presses fire on press; touch fires only for a recognized single-finger tap whose contact began outside widgets.
Positions are logical screen pixels belonging to PrimaryPointerActionEventArgs.View. The game chooses how to hit-test sprites, tiles, or other objects.
Definition at line 84 of file WidgetInputRouter.cs.