pub struct Text { /* private fields */ }
Expand description
UI (on-screen) text.
To use, create the new one using Factory::ui_text
and add it to the scene using Scene::add
.
Implementations
sourceimpl Text
impl Text
sourcepub fn set_pos<P: Into<Point2<f32>>>(&mut self, point: P)
pub fn set_pos<P: Into<Point2<f32>>>(&mut self, point: P)
Change text position. Coordinates in pixels from top-left. Defaults to (0, 0).
sourcepub fn set_size<V: Into<Vector2<f32>>>(&mut self, dimensions: V)
pub fn set_size<V: Into<Vector2<f32>>>(&mut self, dimensions: V)
Change maximum bounds size, in pixels from top-left. Defaults to unbound.
sourcepub fn set_opacity(&mut self, opacity: f32)
pub fn set_opacity(&mut self, opacity: f32)
Change text opacity.
From 0.0
to 1.0
.
Defaults to 1.0
.
sourcepub fn set_font_size(&mut self, size: f32)
pub fn set_font_size(&mut self, size: f32)
Change font size (scale). Defaults to 16.
sourcepub fn set_layout(&mut self, layout: Layout)
pub fn set_layout(&mut self, layout: Layout)
Change text layout.
Defaults to Layout::SingleLine(Align::Left)
.
Trait Implementations
sourceimpl DowncastObject for Text
impl DowncastObject for Text
sourcefn downcast(object: ObjectType) -> Option<Self>
fn downcast(object: ObjectType) -> Option<Self>
Attempts to extract the concrete type of the object from an
ObjectType
. Read moresourceimpl Object for Text
impl Object for Text
sourcefn resolve_data(&self, _: &SyncGuard<'_>) -> Self::Data
fn resolve_data(&self, _: &SyncGuard<'_>) -> Self::Data
Retrieves the internal data for the object. Read more
sourcefn set_visible(&self, visible: bool)
fn set_visible(&self, visible: bool)
Invisible objects are not rendered by cameras.
sourcefn set_transform<P, Q>(&self, pos: P, rot: Q, scale: f32)where
Self: Sized,
P: Into<Point3<f32>>,
Q: Into<Quaternion<f32>>,
fn set_transform<P, Q>(&self, pos: P, rot: Q, scale: f32)where
Self: Sized,
P: Into<Point3<f32>>,
Q: Into<Quaternion<f32>>,
Set both position, orientation and scale.
sourcefn set_orientation<Q>(&self, rot: Q)where
Self: Sized,
Q: Into<Quaternion<f32>>,
fn set_orientation<Q>(&self, rot: Q)where
Self: Sized,
Q: Into<Quaternion<f32>>,
Set orientation.
sourcefn set_weights(&self, weights: Vec<f32>)
fn set_weights(&self, weights: Vec<f32>)
Set weights.
impl Eq for Text
impl StructuralEq for Text
impl StructuralPartialEq for Text
Auto Trait Implementations
impl !RefUnwindSafe for Text
impl !Send for Text
impl !Sync for Text
impl Unpin for Text
impl !UnwindSafe for Text
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
impl<T> SetParameter for T
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Resultwhere
T: Parameter<Self>,
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Resultwhere
T: Parameter<Self>,
Sets
value
as a parameter of self
.