pub struct UiSurface { /* private fields */ }
Implementations§
source§impl UiSurface
impl UiSurface
sourcepub 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.
sourcepub fn try_update_measure(
&mut self,
entity: Entity,
measure_func: MeasureFunc
) -> Option<()>
pub fn try_update_measure( &mut self, entity: Entity, measure_func: MeasureFunc ) -> Option<()>
Update the MeasureFunc
of the taffy node corresponding to the given Entity
if the node exists.
sourcepub 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
.
sourcepub 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.
sourcepub 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.
sourcepub fn set_camera_children(
&mut self,
camera_id: Entity,
children: impl Iterator<Item = Entity>
)
pub fn set_camera_children( &mut self, camera_id: Entity, children: impl Iterator<Item = Entity> )
Set the ui node entities without a Parent
as children to the root node in the taffy layout.
sourcepub fn compute_camera_layout(
&mut self,
camera: Entity,
render_target_resolution: UVec2
)
pub fn compute_camera_layout( &mut self, camera: Entity, render_target_resolution: UVec2 )
Compute the layout for each window entity’s corresponding root node in the layout.
sourcepub 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
sourcepub 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§
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§
source§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
source§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
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§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.source§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.source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
source§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Self
using data from the given World
.