pub struct UiSurface { /* private fields */ }
Implementations§
§impl UiSurface
impl UiSurface
pub fn upsert_node(
&mut self,
entity: Entity,
style: &Style,
context: &LayoutContext
)
pub fn upsert_node( &mut self, entity: Entity, style: &Style, context: &LayoutContext )
Retrieves the Taffy node associated with the given UI node entity and updates its style. If no associated Taffy node exists a new Taffy node is inserted into the Taffy layout.
pub fn update_measure(&mut self, entity: Entity, measure_func: MeasureFunc)
pub fn update_measure(&mut self, entity: Entity, measure_func: MeasureFunc)
Update the MeasureFunc
of the taffy node corresponding to the given Entity
.
pub fn update_children(&mut self, entity: Entity, children: &Children)
pub fn update_children(&mut self, entity: Entity, children: &Children)
Update the children of the taffy node corresponding to the given Entity
.
pub fn try_remove_children(&mut self, entity: Entity)
pub fn try_remove_children(&mut self, entity: Entity)
Removes children from the entity’s taffy node if it exists. Does nothing otherwise.
pub fn try_remove_measure(&mut self, entity: Entity)
pub fn try_remove_measure(&mut self, entity: Entity)
Removes the measure from the entity’s taffy node if it exists. Does nothing otherwise.
pub fn update_window(
&mut self,
window: Entity,
window_resolution: &WindowResolution
)
pub fn update_window( &mut self, window: Entity, window_resolution: &WindowResolution )
Retrieve or insert the root layout node and update its size to match the size of the window.
pub fn set_window_children(
&mut self,
parent_window: Entity,
children: impl Iterator<Item = Entity>
)
pub fn set_window_children( &mut self, parent_window: Entity, children: impl Iterator<Item = Entity> )
Set the ui node entities without a Parent
as children to the root node in the taffy layout.
pub fn compute_window_layouts(&mut self)
pub fn compute_window_layouts(&mut self)
Compute the layout for each window entity’s corresponding root node in the layout.
pub fn remove_entities(&mut self, entities: impl IntoIterator<Item = Entity>)
pub fn remove_entities(&mut self, entities: impl IntoIterator<Item = Entity>)
Removes each entity from the internal map and then removes their associated node from taffy
pub fn get_layout(&self, entity: Entity) -> Result<&Layout, LayoutError>
pub fn get_layout(&self, entity: Entity) -> Result<&Layout, LayoutError>
Get the layout geometry for the taffy node corresponding to the ui node Entity
.
Does not compute the layout geometry, compute_window_layouts
should be run before using this function.
Trait Implementations§
impl Resource for UiSurfacewhere UiSurface: Send + Sync + 'static,
Auto Trait Implementations§
impl !RefUnwindSafe for UiSurface
impl Send for UiSurface
impl Sync for UiSurface
impl Unpin for UiSurface
impl !UnwindSafe for UiSurface
Blanket Implementations§
§impl<T, U> AsBindGroupShaderType<U> for Twhere
U: ShaderType,
&'a T: for<'a> Into<U>,
impl<T, U> AsBindGroupShaderType<U> for Twhere U: ShaderType, &'a T: for<'a> Into<U>,
§fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
T
ShaderType
for self
. When used in AsBindGroup
derives, it is safe to assume that all images in self
exist.source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T, Global>) -> Rc<dyn Any, Global>
fn into_any_rc(self: Rc<T, Global>) -> Rc<dyn Any, Global>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere T: Default,
§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Self
using data from the given World