PistonDevelopers / gfx_text

Draw text for gfx using freetype
http://docs.piston.rs/gfx_text/gfx_text/
MIT License
22 stars 12 forks source link

Basic usage exampe not compiling #46

Open joelwkall opened 8 years ago

joelwkall commented 8 years ago

I can't make basic usage example in the Readme.md compile. The example says:

// Initialize text renderer.
let mut text = gfx_text::new(factory).build().unwrap();

// In render loop:

// Add some text 10 pixels down and right from the top left screen corner.
text.add(
    "The quick brown fox jumps over the lazy dog",  // Text to add
    [10, 10],                                       // Position
    [0.65, 0.16, 0.16, 1.0],                        // Text color
);

// Draw text.
text.draw(&mut stream);

But there is no method draw on Renderer that takes a stream as a parameter, there is only

fn draw<C: CommandBuffer<R>>(&mut self, encoder: &mut Encoder<R, C>, target: &RenderTargetView<R, Rgba8>) -> Result<(), Error>