pub trait UiRoot: Component {
type Param: SystemParam;
type Item: QueryData;
// Required method
fn compute_root_transform(
&mut self,
param: &mut SystemParamItem<'_, '_, Self::Param>,
item: QueryItem<'_, Self::Item>,
) -> (Transform, Vec2);
}Expand description
UI root component.
These provide root transforms and available space for UI nodes. For example, Camera2dRoot
provides a bottom-left transform and physical viewport size as available space.
§Note
Do not add Ui nodes to the same entity as UI roots. Instead, spawn them as
children entities.
Required Associated Types§
Sourcetype Param: SystemParam
type Param: SystemParam
The parameter required for computing the transform and available space.
Required Methods§
Sourcefn compute_root_transform(
&mut self,
param: &mut SystemParamItem<'_, '_, Self::Param>,
item: QueryItem<'_, Self::Item>,
) -> (Transform, Vec2)
fn compute_root_transform( &mut self, param: &mut SystemParamItem<'_, '_, Self::Param>, item: QueryItem<'_, Self::Item>, ) -> (Transform, Vec2)
Computes the root transform. The returned Transform should be located at the bottom-left
vertex of the available space box.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.