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.
fn set_color_mod(&mut self, color: Color)
Set the color mod of the image. Each pixel of the image is multiplied by this color when drawn.
fn set_alpha_mod(&mut self, alpha: u8)
Set the alpha mod of the image. Each pixel's alpha will be multiplied by this value when drawn.
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.