Expand description
Provides a fully fledged UI system for the Ivy framework.
Each UI element is composed of several components. See
crate::constraints
.
Positioning
The different UI widgets are positioned using constraints.
constraints::AbsoluteOffset
specifies an offset in pixels from the parent.
constraints::RelativeOffset
specifies an offset proportional to the size of
the parent. (1.0, 1.0)
specifies the top right corner, and (-1.0, -1.0)
specifies the bottom left corner. This coordinate system is also known as
normalized device coordinates. These constraints can be combined and will be
applied one after another by attaching them both to an entity.
constraints::RelativeSize
size is relative to the parent size. A value larger
than 1.0 signifies that the child is larger than the parent.
constraints::AbsoluteSize
size is given in absolute pixels. If combined with
crate::constraints::RelativeSize
the result is additive. It is possible to supply a
negative absolute size if a relative size is used as it will subtract from
the parent size. This can be used to specify 50% of parent size, but 10
pixels smaller. This is useful for margins.
constraints::Aspect
force the width to be dependent on the height.
constraints::Origin2D
by default, widgets are positioned by their center. The
origin specifies an offset relative to the own size. For example, (1.0, 1.0)
moves the widget to be positioned in respect to the top right.
Re-exports
pub use systems::*;
Modules
Structs
A canvas works as a root marker for the UI hierarchy. The actual size and projection is contained in an attached Camera.
Bundle for widgets. Use further bundles for images and texts
A GUI image component containing a texture and associated sampler. The attached widget component will dictate where and how it will be drawn.
Specialize widget into an image
A mesh renderer using vkCmdDrawIndirectIndexed and efficient batching.
A bundle for spawning an input field.
Marker type specifying that this widget is interactive and will consume click events and not forward them down. Does not neccessarily mean that the widget will react to it. The interactive widget doesn’t neccessarily need to be a visible object, which allows for transparent blockers in menus.
Holds interactive status such as clicked widget and dragging etc.
Provide a function to execute when a widget is clicked. This can be used to send extra events when a specific widget is clicked.
A struct specifying how a widget should react based on hover, press, and release. The struct holds the values which will be used for each state
Layer abstraction for updating reactive components.
Marker type specifying that a widget should remain active even after the mouse button was released. Release events will still be sent, but input will continue to be absorbed and sent to the widget.
Specialize widget into text
An iterator for producing quads for a text string.
Renders arbitrary text using associated font and text objects attached to entity. TextUpdateNode needs to be added to rendergraph before as the text vertex data needs to be updated with a transfer.
UI abstraction layer.
Handles raw input events and filters them through the UI system, and then
through the world in the form of [ivy-input::InputEvent
]s.
A simple vertex type with position, normal and texcoord.
Marker type for UI and the UI hierarchy.
Bundle for widgets. Use further bundles for images and texts
The depth of the widget from the root.
Event for a clicked ui widget
UI component for automatically managing placing of children. Immediate children of a widget with a layout will be placed automatically and have their position constraints ignored.
Enums
Horizontal alignment options for text when a max_width is provided.
Events to control the UI layer
Vertical alignment options for text when a max_height is provided.
A subset of input events for UI widgets