Drag[en]gine Script Module DragonScript
1.23
|
Arrange widgets in box formation along X or Y axis at minimum size. More...
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... | |
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.
void Dragengine.Gui.Layouts.CentrizedBoxLayout.doLayout | ( | Container | container | ) |
Layout widgets in container.
Reimplemented from Dragengine.Gui.Layouts.BoxLayout.
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.
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.
CentrizedBoxLayout Dragengine.Gui.Layouts.CentrizedBoxLayout.new | ( | LayoutAxis | axis | ) |
Create layout with 0 gap and 50% placement.
Reimplemented from Dragengine.Gui.Layouts.BoxLayout.
CentrizedBoxLayout Dragengine.Gui.Layouts.CentrizedBoxLayout.new | ( | LayoutAxis | axis, |
float | placementX, | ||
float | placementY | ||
) |
Create layout with 0 gap and placement.
gap | Size of gap between child widgets. Can be negative to overlap widgets. |
placementX | Percentage placement of box inside available container width. |
placementY | Percentage placement of box inside available container height. |
EInvalidParam | axis is not LayoutAxis.x or LayoutAxis.y. |
CentrizedBoxLayout Dragengine.Gui.Layouts.CentrizedBoxLayout.new | ( | LayoutAxis | axis, |
int | gap | ||
) |
Create layout with gap and 50% placement.
gap | Size of gap between child widgets. Can be negative to overlap widgets. |
EInvalidParam | axis is not LayoutAxis.x or LayoutAxis.y. |
Reimplemented from Dragengine.Gui.Layouts.BoxLayout.
CentrizedBoxLayout Dragengine.Gui.Layouts.CentrizedBoxLayout.new | ( | LayoutAxis | axis, |
int | gap, | ||
float | placementX, | ||
float | placementY | ||
) |
Create layout with gap and placement.
gap | Size of gap between child widgets. Can be negative to overlap widgets. |
placementX | Percentage placement of box inside available container width. |
placementY | Percentage placement of box inside available container height. |
EInvalidParam | axis is not LayoutAxis.x or LayoutAxis.y. |
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.
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.