pub struct Text {
pub value: String,
pub anchor: UiAnchor,
pub justification: Alignment,
pub offset: IntCoords2d,
pub foreground_color: Option<Rgb>,
pub background_color: Option<Rgb>,
}
Expand description
Text UI data that describes how the Text should be visible on the screen.
This text is positioned relative to a camera (like the main camera). If you want text that has a fixed position
in the world, use WorldText
.
Fields§
§value: String
§anchor: UiAnchor
§justification: Alignment
§offset: IntCoords2d
§foreground_color: Option<Rgb>
§background_color: Option<Rgb>
Trait Implementations§
Source§impl Component for Text
impl Component for Text
fn name() -> &'static str
fn component_name(&self) -> &'static str
fn as_any(&self) -> &dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
fn is_component_type(comp: &dyn Component) -> boolwhere
Self: Sized,
fn cast(comp: &dyn Component) -> Option<&Self>where
Self: Sized,
fn cast_mut(comp: &mut dyn Component) -> Option<&mut Self>where
Self: Sized,
Auto Trait Implementations§
impl Freeze for Text
impl RefUnwindSafe for Text
impl Send for Text
impl Sync for Text
impl Unpin for Text
impl UnwindSafe for Text
Blanket Implementations§
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
Mutably borrows from an owned value. Read more