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

Compute​Widget​Bounds


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 → (5)

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.

uniform opt : int32 = 0

Optionally forces grid cells to have equal sizes:
< 0 : the grid may be smaller than the widget bounds, the grid cells will have equal sizes
= 0 : the grid has the same size as the widget bounds, the grid cells may have different sizes
> 0 : the grid may be larger than the widget bounds, the grid cells will have equal sizes

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.