Widget

Description

abstract class Tinman.Engine.Widgets.Widget

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.

Public / Constants

SettingsDefault


public constant SettingsDefault → ("Settings.json":string)

Name of the default settings file (with file name extensions).

Protected / Constructors

Widget


protected constructor Widget → ()

Creates a new instance of Widget.

Protected / Methods

Dirty


protected method 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


[EmptyBody]
protected virtual method DoConsumeInput → (1)

inputEvent in : InputEvent

The user input event.

returns → bool

true if the input event has been consumed, false if not.

Consumes the given user input event.

The given inputEvent in has already been translated to the current widget bounds (see BoundedInput).

DoUpdateGui


[EmptyBody]
protected virtual method DoUpdateGui → (1)

valuesOnly in : bool

true to update values in the existing GUI structure,
false to rebuild the GUI structure before updating values.

Performs the work of IUpdateableGui.UpdateGui.

During the invocation of this method, IsUpdatingGui will return true.

Settings

3 overloads


protected method Settings1 → ()

returns → Path

The canonical settings path.

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).


protected method Settings2 → (1)

path in : string

[not-empty]
Relative path into settings directory.

returns → Path

The canonical settings path.

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).


protected method Settings3 → (1)

path in : Path

[not-null]
Relative path into settings directory.

returns → Path

The canonical settings path.

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


[EmptyBody]
protected virtual method SizeChanged → (1)

size in : Vec2I

The new pixel size.

The pixel size of this widget has changed.

This method is called in these cases:

Protected / Attributes

components


protected attribute components → (ObjectList)

General purpose list of child components.

Subclasses are responsible for initializing this object list.

context


protected attribute context → (IGraphicsContext)

The current IGraphicsContext object or null.

graphics


protected attribute graphics → (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.

input


protected attribute input → (IInputState)

The input state object or null.

inputModifiers


protected attribute inputModifiers → (InputModifiers)

The current input modifiers.

These flags are maintained when IInputConsumer.ConsumeInput is called.

IsUpdatingGui


protected attribute IsUpdatingGui → (get)

value : bool

true if IUpdateableGui.UpdateGui is being called, false if not.

Is IUpdateableGui.UpdateGui being called?

mouse


protected attribute mouse → (Vec2I)

Current position of mouse cursor.

profiler


protected attribute profiler → (IProfiler)

The provided IProfiler object or null if none.

runner


protected attribute runner → (IApplicationRunner)

The provided IApplicationRunner object or null.

screenSize


protected attribute screenSize → (Vec2I)

The current screen size.

widgetGui


protected attribute widgetGui → (IWidgetGui)

The provided IWidgetGui object or null if none.

Configuration

Config


public static attribute Config → (get)

value : IConfigurator<IWidget>

[not-null]
The configurator object.

The configurator object for this type.

Logging

Logger


public static readonly attribute Logger → (ILogger)

The logger object of this class.