Struct ggez::graphics::Text
[−]
[src]
pub struct Text { /* fields omitted */ }
Drawable text created from a Font
.
Methods
impl Text
[src]
fn new(context: &Context, text: &str, font: &Font) -> GameResult<Text>
Renders a new Text
from the given Font
fn width(&self) -> u32
Returns the width of the rendered text, in pixels.
fn height(&self) -> u32
Returns the height of the rendered text, in pixels.
fn contents(&self) -> &str
Returns the string that the text represents.
Trait Implementations
impl Drawable for Text
[src]
fn draw_ex(&mut self,
context: &mut Context,
src: Option<Rect>,
dst: Option<Rect>,
angle: f64,
center: Option<Point>,
flip_horizontal: bool,
flip_vertical: bool)
-> GameResult<()>
context: &mut Context,
src: Option<Rect>,
dst: Option<Rect>,
angle: f64,
center: Option<Point>,
flip_horizontal: bool,
flip_vertical: bool)
-> GameResult<()>
Actually draws the object to the screen. This is the most general version of the operation, which is all that is required for implementing this trait. (It also maps nicely onto SDL2's Renderer::copy_ex(), we might want to wrap the types up a bit more nicely someday.) Read more
fn draw(&mut self,
context: &mut Context,
src: Option<Rect>,
dst: Option<Rect>)
-> GameResult<()>
context: &mut Context,
src: Option<Rect>,
dst: Option<Rect>)
-> GameResult<()>
Draws the drawable onto the rendering target.