pub struct MultiLineText {
pub lines: Vec<String>,
pub position: Position,
pub style: TextStyle,
pub line_spacing: f32,
pub alignment: TextAlignment,
}Expand description
Multi-line text overlay for complex layouts.
Fields§
§lines: Vec<String>Lines of text.
position: PositionPosition on the frame.
style: TextStyleText styling.
line_spacing: f32Line spacing in pixels.
alignment: TextAlignmentAlignment of text within the box.
Implementations§
Source§impl MultiLineText
impl MultiLineText
Sourcepub fn new(lines: Vec<String>, position: Position) -> Self
pub fn new(lines: Vec<String>, position: Position) -> Self
Create a new multi-line text overlay.
Sourcepub fn with_style(self, style: TextStyle) -> Self
pub fn with_style(self, style: TextStyle) -> Self
Set the text style.
Sourcepub fn with_line_spacing(self, spacing: f32) -> Self
pub fn with_line_spacing(self, spacing: f32) -> Self
Set line spacing.
Sourcepub fn with_alignment(self, alignment: TextAlignment) -> Self
pub fn with_alignment(self, alignment: TextAlignment) -> Self
Set text alignment.
Trait Implementations§
Source§impl Clone for MultiLineText
impl Clone for MultiLineText
Source§fn clone(&self) -> MultiLineText
fn clone(&self) -> MultiLineText
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 MultiLineText
impl Debug for MultiLineText
Auto Trait Implementations§
impl Freeze for MultiLineText
impl RefUnwindSafe for MultiLineText
impl Send for MultiLineText
impl Sync for MultiLineText
impl Unpin for MultiLineText
impl UnsafeUnpin for MultiLineText
impl UnwindSafe for MultiLineText
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> 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