IWidgetBounds

Description

interface Tinman.Engine.Widgets.IWidgetBounds

Derived from

IVersioned

Extended by

WidgetBounds abstract

Base interface for classes that compute pixel bounds of IWidget objects.

Public / Methods

ComputeWidgetBounds


public method ComputeWidgetBounds → (2)

width in : int32

[>0]
The screen width (see Graphics.ScreenWidth).

height in : int32

[>0]
The screen height (see Graphics.ScreenWidth).

returns → Box2I

The pixel bounds.

Returns the pixel bounds of the widget on the render target surface.

This method called once during IGraphicsComponent.GraphicsAttach.

Padding


public method Padding → (4)

top in : int32

Padding amount at top edge.

left in : int32

Padding amount at left edge.

bottom in : int32

Padding amount at bottom edge.

right in : int32

Padding amount at right edge.

returns → IWidgetBounds

The resulting widget bounds.

Adjust the widget bounds by padding its edges.

Extensions

Grid


public static method Grid → (4)

countX in : int32

[>0]
Number of grid columns.

countY in : int32

[>0]
Number of grid rows.

in : int32

[0..countX-1]
Column index of grid cell.

in : int32

[0..countY-1]
Row index of grid cell.

returns → IWidgetBounds

The resulting widget bounds.

Divides the widget bounds into a regular grid and fits the widget into the given cell.

Padding


public static method Padding → (1)

padding in : int32

[>=0]
Padding amount at each edge.

returns → IWidgetBounds

The resulting widget bounds.

Adjust the widget bounds by padding its edges.

Split


public static method Split → (1)

first in : bool

true to return the left or upper half,
false to return the right or lower half.

returns → IWidgetBounds

The resulting widget bounds.

Splits the bounds along the longer edge (either horizontally or vertically) and returns one of the resulting halves.