Struct ggez::graphics::Text
[−]
[src]
pub struct Text { /* fields omitted */ }
Drawable text created from a Font
.
Methods
impl Text
[src]
fn new(context: &mut Context, text: &str, font: &Font) -> GameResult<Text>
[src]
Renders a new Text
from the given Font
.
Note that this is relatively computationally expensive; if you want to draw text every frame you probably want to save it and only update it when it changes.
fn width(&self) -> u32
[src]
Returns the width of the rendered text, in pixels.
fn height(&self) -> u32
[src]
Returns the height of the rendered text, in pixels.
fn contents(&self) -> &str
[src]
Returns the string that the text represents.
fn get_dimensions(&self) -> Rect
[src]
Returns the dimensions of the rendered text.
fn get_filter(&self) -> FilterMode
[src]
Get the filter mode for the the rendered text.
fn set_filter(&mut self, mode: FilterMode)
[src]
Set the filter mode for the the rendered text.
Trait Implementations
impl Clone for Text
[src]
fn clone(&self) -> Text
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Drawable for Text
[src]
fn draw_ex(&self, ctx: &mut Context, param: DrawParam) -> GameResult<()>
[src]
Actually draws the object to the screen. Read more
fn set_blend_mode(&mut self, mode: Option<BlendMode>)
[src]
Sets the blend mode to be used when drawing this drawable. This overrides the general graphics::set_blend_mode()
. If None
is set, defers to the blend mode set by graphics::set_blend_mode()
. Read more
fn get_blend_mode(&self) -> Option<BlendMode>
[src]
Gets the blend mode to be used when drawing this drawable.
fn draw(&self, ctx: &mut Context, dest: Point2, rotation: f32) -> GameResult<()>
[src]
Draws the drawable onto the rendering target. Read more