Widget
Description
- Derived from
-
Disposable abstract
IWidget - Extended by
-
CanvasWidget sealed
DefaultControlsWidget abstract
MapViewWidget sealed
ModelWidget sealed
TestWidget sealed
TextureWidget sealed
Tutorial abstract
TutorialBrowser sealed
Base class for IWidget implementations.
The default implementation of IRenderable.Render prepares 2D rendering and calls IRenderable2D.Render2D, passing the Graphics object that has been provided via IGraphicsComponent.GraphicsAttach. The Graphics.ScreenBounds property corresponds to the current widget bounds (see IWidget.ActualBounds).
Protected / Methods
Dirty
Marks the widget as dirty.
When a widget is dirty, the next call to IUpdateableFrameTime.UpdateFrameTime will always return true
and the dirty flag will be cleared.
DoConsumeInput
Consumes the given user input event.
The given inputEvent in has already been translated to the current widget bounds (see IWidget.ActualBounds) and clipped to the non-UI screen region (see INonUserInterfaceBounds.NonUserInterfaceBounds).
DoUpdateGui
Performs the work of IUpdateableGui.UpdateGui.
During the invocation of this method, IsUpdatingGui will return true
.
Settings
3 overloads
Returns the path to the settings directory of this widget, creating parent directories if necessary.
- IOException
-
If a parent directory failed to be created (IFileSystem.DirectoryCreate).
Returns a path into the settings directory of this widget, creating parent directories if necessary.
- IOException
-
If a parent directory failed to be created (IFileSystem.DirectoryCreate).
Returns a path into the settings directory of this widget, creating parent directories if necessary.
- IOException
-
If no settings path has been specified via IWidget.SettingsPath or if a parent directory failed to be created (IFileSystem.DirectoryCreate).
SizeChanged
The pixel size of this widget has changed.
This method is called in these cases:
-
When IGraphicsComponent.GraphicsResize is called.
-
When the IWidget.Bounds property is changed while attached and the resulting pixel bounds have a different size.
-
When the IUpdateableFrameTime.UpdateFrameTime method is called while attached and the widget bounds version (see IVersioned.Version) has changed.
Protected / Attributes
components
General purpose list of child components.
Subclasses are responsible for initializing this object list.
graphics
The current Graphics object or null
.
Use this Graphics object only during rendering (see IGraphicsContext.Graphics for details), i.e. from within one of the following methods:
Use screenSize to query the current screen size.
inputModifiers
The current input modifiers.
These flags are maintained when IInputConsumer.ConsumeInput is called.