-
-
Notifications
You must be signed in to change notification settings - Fork 2
Widgets
Widgets are Gondwana’s system for interactive, reusable interface elements built on top of DirectDrawing.
This includes things like:
- buttons
- labels and text boxes
- menus
- dialogue boxes
- health bars
- draggable panels
- splash screens and other interactive overlays
A widget uses DirectDrawing for its visual representation, but adds the behavior expected from a user-interface element.
Depending on how it is associated, a widget can appear as:
- a SceneLayer-bound world-space element
- a View-bound screen-space interface element
That means the same widget system can support both in-world interaction and traditional HUD or overlay interfaces.
All widgets derive from WidgetBase, which provides the common widget lifecycle and interaction model.
This includes:
- showing and hiding
- activation and cancellation
- pointer hit testing
- pointer enter, leave, down, up, and click events
- optional drag events
Specialized widget base classes add behavior where it is useful. For example, draggable widgets build on the shared pointer pipeline rather than implementing platform-specific mouse or touch handling.
Widget input is coordinated by WidgetInputRouter, which:
- tracks the widgets associated with a render surface
- determines which widget is under the pointer
- routes mouse or touch input to that widget
- manages pointer capture during clicks and drags
- provides a platform-agnostic input path
The platform hosts translate native input into Gondwana input events. Widgets themselves do not need to know whether they are running under WinForms, Avalonia, or Blazor.
DirectDrawing can render almost any custom visual, but rendering alone does not provide the lifecycle and input behavior of a user-interface control.
Widgets provide that higher-level structure while remaining engine-native and platform-agnostic.
If direct drawings are “engine-managed custom visuals,” widgets are “interactive direct drawings with a shared lifecycle and input model.”
Gondwana.Widgets/WidgetBase.csGondwana.Widgets/WidgetInputRouter.csGondwana.Widgets/*
- Home
- Make Your First Game in 30 Minutes
- Engine Architecture Overview
- Gondwana Engine Lifecycle
- Gondwana CLI Cheatsheet
- Assets Files
- Tilesheets
- Scenes and SceneLayers
- Sprites
- Views, Cameras, and Viewports
- DirectDrawing
- Game State Files
- Logging
- Movement and Controllers
- Input Handling
- Collision Detection
- Timers and Engine Timing
- Using the Effects System
- Engine Configuration