[][src]Trait kas::draw::DrawText

pub trait DrawText {
    pub fn prepare_fonts(&mut self);
pub fn text(
        &mut self,
        pass: Pass,
        pos: Vec2,
        bounds: Vec2,
        offset: Vec2,
        text: &TextDisplay,
        col: Colour
    );
pub fn text_col_effects(
        &mut self,
        pass: Pass,
        pos: Vec2,
        bounds: Vec2,
        offset: Vec2,
        text: &TextDisplay,
        col: Colour,
        effects: &[Effect<()>]
    );
pub fn text_effects(
        &mut self,
        pass: Pass,
        pos: Vec2,
        bounds: Vec2,
        offset: Vec2,
        text: &TextDisplay,
        effects: &[Effect<Colour>]
    ); }

Abstraction over text rendering

Note: the current API is designed to meet only current requirements since changes are expected to support external font shaping libraries.

Required methods

pub fn prepare_fonts(&mut self)[src]

Load resources needed for the next frame

pub fn text(
    &mut self,
    pass: Pass,
    pos: Vec2,
    bounds: Vec2,
    offset: Vec2,
    text: &TextDisplay,
    col: Colour
)
[src]

Draw text with a colour

pub fn text_col_effects(
    &mut self,
    pass: Pass,
    pos: Vec2,
    bounds: Vec2,
    offset: Vec2,
    text: &TextDisplay,
    col: Colour,
    effects: &[Effect<()>]
)
[src]

Draw text with a colour and effects

The effects list does not contain colour information, but may contain underlining/strikethrough information. It may be empty.

pub fn text_effects(
    &mut self,
    pass: Pass,
    pos: Vec2,
    bounds: Vec2,
    offset: Vec2,
    text: &TextDisplay,
    effects: &[Effect<Colour>]
)
[src]

Draw text with effects

The effects list provides both underlining and colour information. If the effects list is empty or the first entry has start > 0, a default entity will be assumed.

Loading content...

Implementors

Loading content...