IScreenLabel

Description

interface Tinman.Engine.Drawing.IScreenLabel

Derived from

IVersioned

Extended by

IScreenLabelContent

Callback interface for rendering screen labels while avoiding overlaps.

Public / Methods

PrepareScreenLabel


public method PrepareScreenLabel → (1)

graphics in : Graphics

[not-null]
The graphics object.

returns → Vec2I

The preferred size that shall be used for the label bounds that will be passed to RenderScreenLabel.

Prepares to render this screen label.

RenderScreenLabel


public method RenderScreenLabel → (3)

graphics in : Graphics

[not-null]
The graphics object.

bounds in : Box2I

The screen bounds.

occluded in : bool

true if bounds in are at least partially occluded by other screen labels, false if bounds in are not occluded at all.

Renders this screen label.

The Graphics.PushDepth and Graphics.PopDepth methods are called automatically for screen labels, according to the screen depth that has been provided to the call to ScreenLabelPlacement.Add.

Public / Attributes

IsPixelPerfect


public attribute IsPixelPerfect → (get)

value : bool

true if this screen label must be rendered at integer coordinates,
false if this label may be rendered with sub-pixel offsets.

Does this screen label render pixel-perfect content?

Extensions

Frame


public static method Frame → (1)

style opt : ScreenLabelFrameStyle = null

The style to use or null to use the default style.

returns → IScreenLabelFrame

The framed screen label.

Wraps this screen label in a visual frame.

+-------------------------+   bounds     --+
|     _______________     |                |   Margin
|    /               \    |   border     --+
|   |                 |   |                |   Insets
|   |   +---------+   |   |   label      --+
|   |   |         |   |   |                |
|   |   | wrapped |   |   |                |   size
|   |   |  label  |   |   |                |
|   |   |         |   |   |                |
|   |   +---------+   |   |              --+
|   |                 |   |
|    \_______________/    |
|                         |
+-------------------------+

The bounds are provided as an argument to the IScreenLabel.RenderScreenLabel method. Based on the given bounds, the label layout is computed as follows:

  1. The ScreenLabelFrameStyle.Margin is applied to the bounds. This yields the border.

  2. The ScreenLabelFrameStyle.Insets are applied to the border frame. This yields the label box.

  3. The wrapped screen label is rendered into the label box.

Stack


public static method Stack → (3)

other in : IScreenLabel

[not-null]
The other screen label to stack with.

horizontal in : bool

true to stack horizontally (this left, other in right),
false to stack vertically (this top, other in bottom).

pad opt : int32 = 0

[>=0]
Padding between screen labels.

returns → IScreenLabelContent

The stacked screen label.

Stacks this screen label with the given other in one.