Expand description
The UI prelude.
This includes the most common types in this crate, re-exported for your convenience.
Structs§
- Angular
Color Stop - An angular color stop for a conic gradient
- Background
Color - The background color of the node
- Background
Gradient - A UI node that displays a gradient
- Border
Color - The border color of the UI node.
- Border
Gradient - A UI node border that displays a gradient
- Border
Radius - Used to add rounded corners to a UI node. You can set a UI node to have uniformly rounded corners or specify different radii for each corner. If a given radius exceeds half the length of the smallest dimension between the node’s height or width, the radius will calculated as half the smallest dimension.
- Border
Rect - Defines the extents of the border of a rectangle.
- BoxShadow
- List of shadows to draw for a
Node
. - Button
- Marker struct for buttons
- Calculated
Clip - The calculated clip of the node
- Color
Stop - A color stop for a gradient
- Computed
Node - Provides the computed size and layout properties of the node.
- Computed
UiRender Target Info - Derived information about the render target for this UI node.
- Computed
UiTarget Camera - Derived information about the camera target for this UI node.
- Conic
Gradient - A conic gradient
- Default
UiCamera - GlobalZ
Index GlobalZIndex
allows aNode
entity anywhere in the UI hierarchy to escape the implicit draw ordering of the UI’s layout tree and be rendered above or below other UI nodes. Nodes with aGlobalZIndex
of greater than 0 will be drawn on top of nodes without aGlobalZIndex
or nodes with a lowerGlobalZIndex
. Nodes with aGlobalZIndex
of less than 0 will be drawn below nodes without aGlobalZIndex
or nodes with a greaterGlobalZIndex
.- Grid
Placement - Represents the position of a grid item in a single axis.
- Grid
Track - A
GridTrack
is a Row or Column of a CSS Grid. This struct specifies what size the track should be. See below for the different “track sizing functions” you can specify. - Image
Node - A UI Node that renders an image.
- IsDefault
UiCamera - Marker used to identify default cameras, they will have priority over the
PrimaryWindow
camera. - Label
- Marker struct for labels
- Layout
Config - This component can be added to any UI node to modify its layout behavior.
- Linear
Gradient - A linear gradient
- Node
- The base component for UI entities. It describes UI layout and style properties.
- Outline
- The
Outline
component adds an outline outside the edge of a UI node. Outlines do not take up space in the layout. - Overflow
- Whether to show or hide overflowing items
- Overflow
Clip Margin - The bounds of the visible area when a UI node is clipped.
- Override
Clip - UI node entities with this component will ignore any clipping rect they inherit,
the node will not be clipped regardless of its ancestors’
Overflow
setting. - Radial
Gradient - A radial gradient
- Repeated
Grid Track - Represents a possibly repeated
GridTrack
. - Resolved
Border Radius - Represents the resolved border radius values for a UI node.
- Scroll
Position - The scroll position of the node. Values are in logical pixels, increasing from top-left to bottom-right.
- Shadow
Style - Text
- The top-level UI text component.
- Text
Background Color - The background color of the text for this section.
- Text
Shadow - Adds a shadow behind text
- Texture
Slicer - Slices a texture using the 9-slicing technique. This allows to reuse an image at various sizes without needing to prepare multiple assets. The associated texture will be split into nine portions, so that on resize the different portions scale or tile in different ways to keep the texture in proportion.
- UiGlobal
Transform - Absolute 2D transform for UI nodes
- UiPosition
- Responsive position relative to a UI node.
- UiRect
- A type which is commonly used to define margins, paddings and borders.
- UiScale
- The current scale of the UI.
- UiTarget
Camera - Indicates that this root
Node
entity should be rendered to a specific camera. - UiTransform
- Relative 2D transform for UI nodes
- Val2
- A pair of
Val
s used to represent a 2-dimensional size or offset. - Viewport
Node - Component used to render a
Camera::target
to a node. - ZIndex
- Indicates that this
Node
entity’s front-to-back ordering is not controlled solely by its location in the UI hierarchy. A node with a higher z-index will appear on top of sibling nodes with a lower z-index.
Enums§
- Align
Content - Used to control how items are distributed.
- Align
Items - Used to control how each individual item is aligned by default within the space they’re given.
- Align
Self - Used to control how the specified item is aligned within the space it’s given.
- BoxSizing
- Which part of a Node’s box length styles like width and height control
- Display
- Defines the layout model used by this node.
- Flex
Direction - Defines how flexbox items are ordered within a flexbox
- Flex
Wrap - Defines if flexbox items appear on a single line or on multiple lines
- Gradient
- Grid
Auto Flow - Controls whether grid items are placed row-wise or column-wise as well as whether the sparse or dense packing algorithm is used.
- Grid
Placement Error - Errors that occur when setting constraints for a
GridPlacement
- Grid
Track Repetition - How many times to repeat a repeated grid track
- Interaction
- Describes what type of input interaction has occurred for a UI node.
- Interpolation
Color Space - The color space used for interpolation.
- Justify
Content - Used to control how items are distributed.
- Justify
Items - Used to control how each individual item is aligned by default within the space they’re given.
- Justify
Self - Used to control how the specified item is aligned within the space it’s given.
- MaxTrack
Sizing Function - MinTrack
Sizing Function - Node
Image Mode - Controls how the image is altered to fit within the layout and how the layout algorithm determines the space in the layout for the image
- Overflow
Axis - Whether to show or hide overflowing items
- Overflow
Clip Box - Used to determine the bounds of the visible area when a UI node is clipped.
- Position
Type - The strategy used to position this node
- Radial
Gradient Shape - Slice
Scale Mode - Defines how a texture slice scales when resized
- Sprite
Image Mode - Controls how the image is altered when scaled.
- Val
- Represents the possible value types for layout properties.
- ValArithmetic
Error - ValParse
Error
Traits§
- InColor
Space - Set the color space used for interpolation.
- ValNum
- All the types that should be able to be used in the
Val
enum should implement this trait.
Functions§
- auto
- Returns a
Val::Auto
where the value is automatically determined based on the context and otherNode
properties. - percent
- Returns a
Val::Percent
representing a percentage of the parent node’s length along a specific axis. - px
- Returns a
Val::Px
representing a value in logical pixels. - vh
- Returns a
Val::Vh
representing a percentage of the viewport height. - vmax
- Returns a
Val::VMax
representing a percentage of the viewport’s larger dimension. - vmin
- Returns a
Val::VMin
representing a percentage of the viewport’s smaller dimension. - vw
- Returns a
Val::Vw
representing a percentage of the viewport width.
Type Aliases§
- Text
UiReader - UI alias for
TextReader
. - Text
UiWriter - UI alias for
TextWriter
.