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 IConfigurable.ToConfig returns ConfigValue.Invalid, which indicates that the class does not support the Config API. Subclasses that wish to process screenshot requests via IWidget.Screenshot must call ScreenshotProcess from their IRenderable2D.Render2D.
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
.
ScreenshotEffect
Renders the visual effect after taking a screenshot.
This method is called by ScreenshotProcess.
The default implementation renders a simple white flashlight effect.
ScreenshotProcess
Processes the pending screenshot request and renders the post-screenshot visual effect.
This method must be called by subclasses from their IRenderable2D.Render2D method, if they wish to process screenshot requests. The built-in screenshot command via KeyboardKey.Pause will only be active if this method has been called at least once.
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 populating 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.