[][src]Struct gfx_text::Renderer

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

Text renderer.

Methods

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

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

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

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

Draw the current scene and clear state.

Examples

This example is not 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();

Draw using provided projection matrix.

Examples

This example is not 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();

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

Auto Trait Implementations

impl<R, F> Send for Renderer<R, F> where
    F: Send,
    <R as Resources>::Buffer: Send + Sync,
    <R as Resources>::Mapping: Send,
    <R as Resources>::PipelineStateObject: Send + Sync,
    <R as Resources>::Program: Send + Sync,
    <R as Resources>::Sampler: Send + Sync,
    <R as Resources>::Shader: Send + Sync,
    <R as Resources>::ShaderResourceView: Send + Sync,
    <R as Resources>::Texture: Send + Sync

impl<R, F> Sync for Renderer<R, F> where
    F: Sync,
    <R as Resources>::Buffer: Send + Sync,
    <R as Resources>::Mapping: Send,
    <R as Resources>::PipelineStateObject: Send + Sync,
    <R as Resources>::Program: Send + Sync,
    <R as Resources>::Sampler: Send + Sync,
    <R as Resources>::Shader: Send + Sync,
    <R as Resources>::ShaderResourceView: Send + Sync,
    <R as Resources>::Texture: Send + Sync

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

Performs the conversion.

impl<T> From for T
[src]

Performs the conversion.

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T> Borrow for T where
    T: ?Sized
[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut for T where
    T: ?Sized
[src]

Mutably borrows from an owned value. Read more

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

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

this method will likely be replaced by an associated static

Gets the TypeId of self. Read more