Struct gfx_glyph::Section [] [src]

pub struct Section<'a> {
    pub text: &'a str,
    pub screen_position: (f32, f32),
    pub bounds: (f32, f32),
    pub scale: Scale,
    pub color: [f32; 4],
    pub z: f32,
    pub layout: Layout<BuiltInLineBreaker>,
    pub font_id: FontId,
}

An object that contains all the info to render a section of text.

For varied font/scale/color sections see VariedSection.

Example

use gfx_glyph::Section;

let section = Section {
    text: "Hello gfx_glyph",
    ..Section::default()
};

Fields

Text to render

Position on screen to render text, in pixels from top-left. Defaults to (0, 0).

Max (width, height) bounds, in pixels from top-left. Defaults to unbounded.

Font scale. Defaults to 16

Rgba color of rendered text. Defaults to black.

Z values for use in depth testing. Defaults to 0.0

Built in layout, can overridden with custom layout logic see queue_custom_layout

Font id to use for this section.

It must be known to the GlyphBrush it is being used with, either FontId::default() or the return of add_font.

Trait Implementations

impl<'a> Debug for Section<'a>
[src]

[src]

Formats the value using the given formatter. Read more

impl<'a> Clone for Section<'a>
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<'a> Copy for Section<'a>
[src]

impl Default for Section<'static>
[src]

[src]

Returns the "default value" for a type. Read more

impl<'a, 'b> From<&'b Section<'a>> for VariedSection<'a>
[src]

[src]

Performs the conversion.

impl<'a> From<Section<'a>> for VariedSection<'a>
[src]

[src]

Performs the conversion.

impl<'a> From<Section<'a>> for Cow<'a, VariedSection<'a>>
[src]

[src]

Performs the conversion.

impl<'a, 'b> From<&'b Section<'a>> for Cow<'a, VariedSection<'a>>
[src]

[src]

Performs the conversion.

Auto Trait Implementations

impl<'a> Send for Section<'a>

impl<'a> Sync for Section<'a>