Drag[en]gine Script Module DragonScript  1.21
Dragengine.Gui.Layouts.CentrizedBoxLayout Class Reference

Arrange widgets in box formation along X or Y axis at minimum size. More...

Inheritance diagram for Dragengine.Gui.Layouts.CentrizedBoxLayout:
Dragengine.Gui.Layouts.BoxLayout Dragengine.Gui.Layout

Public Member Functions

void doLayout (Container container)
 Layout widgets in container. More...
 
float getPlacementX ()
 Percentage placement of box inside available container width. More...
 
float getPlacementY ()
 Percentage placement of box inside available container height. More...
 
CentrizedBoxLayout new (LayoutAxis axis)
 Create layout with 0 gap and 50% placement. More...
 
CentrizedBoxLayout new (LayoutAxis axis, float placementX, float placementY)
 Create layout with 0 gap and placement. More...
 
CentrizedBoxLayout new (LayoutAxis axis, int gap)
 Create layout with gap and 50% placement. More...
 
CentrizedBoxLayout new (LayoutAxis axis, int gap, float placementX, float placementY)
 Create layout with gap and placement. More...
 
void setPlacementX (float placement)
 Set percentage placement of box inside available container width. More...
 
void setPlacementY (float placement)
 Set percentage placement of box inside available container height. More...
 
- Public Member Functions inherited from Dragengine.Gui.Layouts.BoxLayout
void addWidget (Widget widget, Object settings)
 Add widget to layout using settings. More...
 
LayoutAxis getAxis ()
 Axis to arrange widgets along. More...
 
int getGap ()
 Gap between child widgets. More...
 
Point getMinimumSize (Container container)
 Minimal size required for layout in container. More...
 
Point getMinimumSizeForHeight (Container container, int height)
 Minimum size of layout using reference widget height and variable width. More...
 
Point getMinimumSizeForWidth (Container container, int width)
 Minimum size of layout using reference width and variable height. More...
 
void removeWidget (Widget widget)
 Remove widget from layout. More...
 
void setAxis (LayoutAxis axis)
 Set axis to arrange along. More...
 
void setGap (int gap)
 Set gap between child widgets. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Dragengine.Gui.Layouts.BoxLayout
Point getMinimumSizeFor (Container container, int width, int height)
 Minimum size of layout using reference and variable size. More...
 

Detailed Description

Arrange widgets in box formation along X or Y axis at minimum size.

Widgets are resized to fit their requested minimum size. Extra space is distributed around all laid out widgets using percentage placement to place the widget box in the container. In contrary to BoxLayout the widgets are not forced to equal size nor are they stretched. The placement allows to place the box anywhere inside the container area. A value of 0 places the widgets at the left respective top border. A value of 1 places the widgets at the right respective bottom border. The default value of 0.5 centers the widgets in the center of the container. Values outside the range from 0 to 1 are allowed and can be used for example to create "fly-in/fly-out" effects by animating the placement value. You have to call Container.doLayout() after changing the parameter to apply the changes.

Instances of this layout can be shared by multiple widgets.

Member Function Documentation

◆ doLayout()

void Dragengine.Gui.Layouts.CentrizedBoxLayout.doLayout ( Container  container)

Layout widgets in container.

Reimplemented from Dragengine.Gui.Layouts.BoxLayout.

◆ getPlacementX()

float Dragengine.Gui.Layouts.CentrizedBoxLayout.getPlacementX ( )

Percentage placement of box inside available container width.

Value of 0 places the box on the left border. Value 1 places the box on the right border. Values in between shift the box between left and right border. Values outside the range of 0 to 1 are allowed.

◆ getPlacementY()

float Dragengine.Gui.Layouts.CentrizedBoxLayout.getPlacementY ( )

Percentage placement of box inside available container height.

Value of 0 places the box on the top border. Value 1 places the box on the bottom border. Values in between shift the box between top and bottom border. Values outside the range of 0 to 1 are allowed.

◆ new() [1/4]

CentrizedBoxLayout Dragengine.Gui.Layouts.CentrizedBoxLayout.new ( LayoutAxis  axis)

Create layout with 0 gap and 50% placement.

Reimplemented from Dragengine.Gui.Layouts.BoxLayout.

◆ new() [2/4]

CentrizedBoxLayout Dragengine.Gui.Layouts.CentrizedBoxLayout.new ( LayoutAxis  axis,
float  placementX,
float  placementY 
)

Create layout with 0 gap and placement.

Parameters
gapSize of gap between child widgets. Can be negative to overlap widgets.
placementXPercentage placement of box inside available container width.
placementYPercentage placement of box inside available container height.
Exceptions
EInvalidParamaxis is not LayoutAxis.x or LayoutAxis.y.

◆ new() [3/4]

CentrizedBoxLayout Dragengine.Gui.Layouts.CentrizedBoxLayout.new ( LayoutAxis  axis,
int  gap 
)

Create layout with gap and 50% placement.

Parameters
gapSize of gap between child widgets. Can be negative to overlap widgets.
Exceptions
EInvalidParamaxis is not LayoutAxis.x or LayoutAxis.y.

Reimplemented from Dragengine.Gui.Layouts.BoxLayout.

◆ new() [4/4]

CentrizedBoxLayout Dragengine.Gui.Layouts.CentrizedBoxLayout.new ( LayoutAxis  axis,
int  gap,
float  placementX,
float  placementY 
)

Create layout with gap and placement.

Parameters
gapSize of gap between child widgets. Can be negative to overlap widgets.
placementXPercentage placement of box inside available container width.
placementYPercentage placement of box inside available container height.
Exceptions
EInvalidParamaxis is not LayoutAxis.x or LayoutAxis.y.

◆ setPlacementX()

void Dragengine.Gui.Layouts.CentrizedBoxLayout.setPlacementX ( float  placement)

Set percentage placement of box inside available container width.

Value of 0 places the box on the left border. Value 1 places the box on the right border. Values in between shift the box between left and right border. Values outside the range of 0 to 1 are allowed.

◆ setPlacementY()

void Dragengine.Gui.Layouts.CentrizedBoxLayout.setPlacementY ( float  placement)

Set percentage placement of box inside available container height.

Value of 0 places the box on the top border. Value 1 places the box on the bottom border. Values in between shift the box between top and bottomborder. Values outside the range of 0 to 1 are allowed.


The documentation for this class was generated from the following file: