Struct gfx_glyph::OwnedSection
source · pub struct OwnedSection<X = Extra> {
pub screen_position: (f32, f32),
pub bounds: (f32, f32),
pub layout: Layout<BuiltInLineBreaker>,
pub text: Vec<OwnedText<X>, Global>,
}
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
text: Vec<OwnedText<X>, Global>
Text to render, rendered next to one another according the layout.
Implementations§
source§impl<X> OwnedSection<X>
impl<X> OwnedSection<X>
pub fn with_screen_position<P>(self, position: P) -> OwnedSection<X>where P: Into<(f32, f32)>,
pub fn with_bounds<P>(self, bounds: P) -> OwnedSection<X>where P: Into<(f32, f32)>,
pub fn with_layout<L>(self, layout: L) -> OwnedSection<X>where L: Into<Layout<BuiltInLineBreaker>>,
pub fn add_text<T>(self, text: T) -> OwnedSection<X>where T: Into<OwnedText<X>>,
pub fn with_text<X2>(self, text: Vec<OwnedText<X2>, Global>) -> OwnedSection<X2>
source§impl<X> OwnedSection<X>where
X: Clone,
impl<X> OwnedSection<X>where X: Clone,
pub fn to_borrowed(&self) -> Section<'_, X>
Trait Implementations§
source§impl<X> Clone for OwnedSection<X>where
X: Clone,
impl<X> Clone for OwnedSection<X>where X: Clone,
source§fn clone(&self) -> OwnedSection<X>
fn clone(&self) -> OwnedSection<X>
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<X> Debug for OwnedSection<X>where
X: Debug,
impl<X> Debug for OwnedSection<X>where X: Debug,
source§impl<X> Default for OwnedSection<X>where
X: Default,
impl<X> Default for OwnedSection<X>where X: Default,
source§fn default() -> OwnedSection<X>
fn default() -> OwnedSection<X>
Returns the “default value” for a type. Read more
source§impl<X> PartialEq<OwnedSection<X>> for OwnedSection<X>where
X: PartialEq<X>,
impl<X> PartialEq<OwnedSection<X>> for OwnedSection<X>where X: PartialEq<X>,
source§fn eq(&self, other: &OwnedSection<X>) -> bool
fn eq(&self, other: &OwnedSection<X>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.