Crate cuicui_layout
source ·Expand description
Layouting system for bevy cuicui.
The layouting system is very dumb. It is based on Container
s.
A Container
layouts its content in either a column or a row.
The individual items are positioned according to:
Container::align
: The container’s childrenAlignment
.Container::distrib
: The container’s childrenDistribution
.Container::flow
: The direction in which the container’s childrenFlow
.
By default, items are aligned at the center of the container, distributed on the flow direction evenly within the container.
All things in a cuicui layout has a known size. This is why everything needs to live in a root container of a fixed size.
That’s it! Now make a nice UI using bevy.
Modules
- Bevy [
Bundle
]s grouping components used by the layouting systems. - The base
MakeBundle
for layouts.
Macros
- Wrapper around
MakeBundle
.
Structs
- An error caused by a bad layout.
- Parameters of a container, ie: a node that contains other nodes.
- Use this camera’s logical size as the root fixed-size container for
cuicui_layout
. - Add the
compute_layout
system to the bevyUpdate
set. - Position and size of a
Node
as computed by the layouting algo. - Set this
Root
to track theLayoutRootCamera
’s size. - A
T
that applies to thewidth
andheight
of something.
Enums
- The cross axis alignment. Aka alignment.
- The main axis alignment. Aka distribution.
- The layout direction of a
Container
. - A constraint on an axis of a terminal
Node
(ie: doesn’t have aChildren
constraint). - A [
Component
] integrating the attached [Entity
] into thecuicui_layout
layouting algorithm. - A constraint on an axis of containers.
- Systems added by
Plug
.
Functions
- Update transform of things that have a
PosRect
component.
Type Definitions
WorldQuery
item used by the layout function.