Struct glyph_brush::SectionBuilder
source · pub struct SectionBuilder {
pub screen_position: (f32, f32),
pub bounds: (f32, f32),
pub layout: Layout<BuiltInLineBreaker>,
}
Expand description
Section
builder.
Usage can avoid generic X
type issues as it’s not mentioned until text is involved.
Fields§
§screen_position: (f32, f32)
Position on screen to render text, in pixels from top-left. Defaults to (0, 0).
bounds: (f32, f32)
Max (width, height) bounds, in pixels from top-left. Defaults to unbounded.
layout: Layout<BuiltInLineBreaker>
Built in layout, can be overridden with custom layout logic
see queue_custom_layout
Implementations§
source§impl SectionBuilder
impl SectionBuilder
pub fn with_screen_position<P: Into<(f32, f32)>>(self, position: P) -> Self
pub fn with_bounds<P: Into<(f32, f32)>>(self, bounds: P) -> Self
pub fn with_layout<L: Into<Layout<BuiltInLineBreaker>>>(self, layout: L) -> Self
pub fn add_text<X>(self, text: Text<'_, X>) -> Section<'_, X>
pub fn with_text<X>(self, text: Vec<Text<'_, X>>) -> Section<'_, X>
pub fn add_owned_text<X>(self, text: OwnedText<X>) -> OwnedSection<X>
pub fn with_owned_text<X>(self, text: Vec<OwnedText<X>>) -> OwnedSection<X>
Trait Implementations§
source§impl Clone for SectionBuilder
impl Clone for SectionBuilder
source§fn clone(&self) -> SectionBuilder
fn clone(&self) -> SectionBuilder
Returns a copy 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 SectionBuilder
impl Debug for SectionBuilder
source§impl Default for SectionBuilder
impl Default for SectionBuilder
source§impl PartialEq for SectionBuilder
impl PartialEq for SectionBuilder
source§fn eq(&self, other: &SectionBuilder) -> bool
fn eq(&self, other: &SectionBuilder) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for SectionBuilder
impl StructuralPartialEq for SectionBuilder
Auto Trait Implementations§
impl RefUnwindSafe for SectionBuilder
impl Send for SectionBuilder
impl Sync for SectionBuilder
impl Unpin for SectionBuilder
impl UnwindSafe for SectionBuilder
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