pub struct Text {
pub text: String,
pub x: f32,
pub y: f32,
pub font_size: f32,
pub color: Color,
pub anchor: String,
pub z_index: isize,
}Expand description
A text object.
Fields§
§text: StringThe text to display.
x: f32The x position of the anchor.
y: f32The y position of the anchor.
font_size: f32The font size of the text.
color: ColorThe color of the text.
anchor: StringThe anchor of the text. This is where the x and y position of the text is relative to the actual text.
see: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/text-anchor
z_index: isizeThe z-index of the text.
Implementations§
Source§impl Text
impl Text
Sourcepub fn anchor(self, anchor: impl Into<String>) -> Self
pub fn anchor(self, anchor: impl Into<String>) -> Self
Sets the anchor of the text.
see: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/text-anchor
Trait Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more