pub enum TextPosition {
Pixels(Vec2),
Percentage(Vec2),
}
Expand description
Specifies the unit used by the position
property of a TextRef
.
Variants§
Pixels(Vec2)
Position is interpreted as pixel values.
§Examples
TextPosition::Pixels(vec2(0.0, 64.0))
: Move the text up by exactly64
pixels
Percentage(Vec2)
Position is interpreted as a percentage of the viewport’s size.
§Examples
TextPosition::Percentage(vec2(0.5, 0.0))
: Move the text to the right by half the viewport’s width in pixels
Trait Implementations§
Source§impl Clone for TextPosition
impl Clone for TextPosition
Source§fn clone(&self) -> TextPosition
fn clone(&self) -> TextPosition
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for TextPosition
impl Debug for TextPosition
impl Copy for TextPosition
Auto Trait Implementations§
impl Freeze for TextPosition
impl RefUnwindSafe for TextPosition
impl Send for TextPosition
impl Sync for TextPosition
impl Unpin for TextPosition
impl UnwindSafe for TextPosition
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