Module ambient_ui::layout
source · Expand description
Implements all of the Elements used for layouting.
The layout is roughly based on Windows Forms.
There are two major layout components, Dock and Flow (which includes FlowColumn and FlowRow).
Structs
- An entry in a Bookcase.
- A docking layout, where each child specifies which side of the parent it should be docked to. It is top-down: it starts with a given area (say the screen) and then divides it into smaller pieces with each new element added to it.
- A FixedGrid is a grid of elements with a fixed stride.
- A flow layout. It is bottom-up: it auto-resizes itself to fit its constituent components.
- A FlowColumn is a Flow that is oriented vertically.
- Sets the
translation
ofinner
to offset its size in the selected axes. Note that you will have to use another mechanism to move the inner element as a result. - Measures the absolute position of its inner element and calls the callback when it changes.
- Measures the size of its inner element and calls the callback when it changes.
- A simple separator, similar to
<hr>
in HTML. - A Dock that is always the size of the window.
Enums
- Align: Layout alignment.
- Docking: The edge to dock to.
- Fit: Layout fit.
- Layout: The type of the layout to use.
- Orientation: Layout orientation.
Functions
- Align horizontal: Layout alignment: horizontal.
- Align vertical: Layout alignment: vertical.
- Docking: Layout docking.
- Fit horizontal: Layout fit: horizontal.
- Fit vertical: Layout fit: vertical.
- GPU UI size: Upload the width and height of this UI element to the GPU.
- Height: The height of a UI element.
- Is book file: This is a file in a
layout_bookcase
. - Is screen: This entity will be treated as a screen. Used by the Screen ui component.
- Layout: Layout.
- Margin: Layout margin: [top, right, bottom, left].
- Maximum height: The maximum height of a UI element.
- Maximum width: The maximum width of a UI element.
- Mesh to local from size: Update the
mesh_to_local
based on the width and height of this entity. - Minimum height: The minimum height of a UI element.
- Minimum width: The minimum width of a UI element.
- Orientation: Layout orientation.
- Padding: Layout padding: [top, right, bottom, left].
- Space between items: Space between items in a layout.
- Width: The width of a UI element.