Struct bevy::ui::node_bundles::TextBundle
pub struct TextBundle {
pub node: Node,
pub style: Style,
pub text: Text,
pub calculated_size: CalculatedSize,
pub focus_policy: FocusPolicy,
pub transform: Transform,
pub global_transform: GlobalTransform,
pub visibility: Visibility,
pub computed_visibility: ComputedVisibility,
pub z_index: ZIndex,
pub background_color: BackgroundColor,
}
Expand description
A UI node that is text
Fields§
§node: Node
Describes the logical size of the node
style: Style
Describes the style including flexbox settings
text: Text
Contains the text of the node
calculated_size: CalculatedSize
The calculated size based on the given image
focus_policy: FocusPolicy
Whether this node should block interaction with lower nodes
transform: Transform
The transform of the node
This field is automatically managed by the UI layout system.
To alter the position of the NodeBundle
, use the properties of the Style
component.
global_transform: GlobalTransform
The global transform of the node
This field is automatically managed by the UI layout system.
To alter the position of the NodeBundle
, use the properties of the Style
component.
visibility: Visibility
Describes the visibility properties of the node
computed_visibility: ComputedVisibility
Algorithmically-computed indication of whether an entity is visible and should be extracted for rendering
z_index: ZIndex
Indicates the depth at which the node should appear in the UI
background_color: BackgroundColor
The background color that will fill the containing node
Implementations§
§impl TextBundle
impl TextBundle
pub fn from_section(value: impl Into<String>, style: TextStyle) -> TextBundle
pub fn from_section(value: impl Into<String>, style: TextStyle) -> TextBundle
Create a TextBundle
from a single section.
See Text::from_section
for usage.
pub fn from_sections(
sections: impl IntoIterator<Item = TextSection>
) -> TextBundle
pub fn from_sections( sections: impl IntoIterator<Item = TextSection> ) -> TextBundle
Create a TextBundle
from a list of sections.
See Text::from_sections
for usage.
pub const fn with_text_alignment(self, alignment: TextAlignment) -> TextBundle
pub const fn with_text_alignment(self, alignment: TextAlignment) -> TextBundle
Returns this TextBundle
with a new TextAlignment
on Text
.
pub const fn with_style(self, style: Style) -> TextBundle
pub const fn with_style(self, style: Style) -> TextBundle
Returns this TextBundle
with a new Style
.
pub const fn with_background_color(self, color: Color) -> TextBundle
pub const fn with_background_color(self, color: Color) -> TextBundle
Returns this TextBundle
with a new BackgroundColor
.
Trait Implementations§
§impl Clone for TextBundle
impl Clone for TextBundle
§fn clone(&self) -> TextBundle
fn clone(&self) -> TextBundle
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for TextBundle
impl Debug for TextBundle
§impl Default for TextBundle
impl Default for TextBundle
§fn default() -> TextBundle
fn default() -> TextBundle
impl Bundle for TextBundle
Auto Trait Implementations§
impl RefUnwindSafe for TextBundle
impl Send for TextBundle
impl Sync for TextBundle
impl Unpin for TextBundle
impl UnwindSafe for TextBundle
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.§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, 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>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
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