Struct gfx_text::Renderer [] [src]

pub struct Renderer<R: Resources, F: Factory<R>> { /* fields omitted */ }

Text renderer.

Methods

impl<R: Resources, F: Factory<R>> Renderer<R, F>
[src]

[src]

Add some text to the current draw scene relative to the top left corner of the screen using pixel coordinates.

[src]

Add text to the draw scene by anchoring an edge or mid-point to a position defined in screen pixel coordinates.

[src]

Add some text to the draw scene using absolute world coordinates.

[src]

Draw the current scene and clear state.

Examples

Be careful when using this code, it's not being tested!
text.add("Test1", [10, 10], [1.0, 0.0, 0.0, 1.0]);
text.add("Test2", [20, 20], [0.0, 1.0, 0.0, 1.0]);
text.draw(&mut encoder, &color_output).unwrap();

[src]

Draw using provided projection matrix.

Examples

Be careful when using this code, it's not being tested!
text.add_at("Test1", [6.0, 0.0, 0.0], [1.0, 0.0, 0.0, 1.0]);
text.add_at("Test2", [0.0, 5.0, 0.0], [0.0, 1.0, 0.0, 1.0]);
text.draw_at(&mut encoder, &color_output, camera_projection).unwrap();

[src]

Get the bounding box size of a string as rendered by this font.