#[repr(C)]
pub struct TextIns { pub font_t1: Vec2, pub font_t2: Vec2, pub color: Vec4, pub rect_pos: Vec2, pub rect_size: Vec2, pub char_depth: f32, pub base: Vec2, pub font_size: f32, pub char_offset: f32, pub marker: f32, }

Fields

font_t1: Vec2

Texture coordinates for the bottom-left corner of the glyph in the texture atlas

font_t2: Vec2

Texture coordinates for the top-right corner of the glyph in the texture atlas

color: Vec4

Color for a glyph, usually set at the same color as TextIns

rect_pos: Vec2

Glyph position in view space

rect_size: Vec2

Glyph size in view space

char_depth: f32

Depth offset (prevents z-fighting)

base: Vec2

Position used in TextIns::closest_offset.

font_size: f32

Font size in pixels

char_offset: f32

Character index in the text string

marker: f32

TODO(JP): document.

Implementations

Draw text using absolute positioning.

This does not use the layouting system in Zaplib.

Only single-line text is supported. This means that you can only use Wrapping::None and Wrapping::Ellipsis for TextInsProps::wrapping.

Draw text and walk in the layout system.

Calls cx.add_box for each “chunk” of text (depending on TextInsProps::wrapping).

TODO(JP): This doesn’t seem to work well with Direction::Down (or other directions for that matter). Not a high priority but might good to be aware of.

TextInsProps::position_anchoring is ignored by this function.

Looks up text with the behavior of a text selection mouse cursor.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.