Type Definition ggez::graphics::Canvas [] [src]

type Canvas = CanvasGeneric<GlBackendSpec>;

A canvas that can be rendered to instead of the screen (sometimes referred to as "render target" or "render to texture"). Set the canvas with the ggez::graphics::set_canvas() function, and then anything you draw will be drawn to the canvas instead of the screen.

Resume drawing to the screen by calling ggez::graphics::set_canvas(None).

A Canvas allows creating render targets to be used instead of the screen. This allows graphics to be rendered to images off-screen in order to do things like saving to an image file or creating cool effects by using shaders that render to an image. If you just want to draw multiple things efficiently, look at SpriteBatch.

Methods

impl Canvas
[src]

[src]

Create a new canvas with the given size and number of samples.

[src]

Create a new canvas with the current window dimensions.

[src]

Gets the backend Image that is being rendered to.

[src]

Destroys the Canvas and returns the Image it contains.

Trait Implementations

impl Drawable for Canvas
[src]

[src]

Actually draws the object to the screen. Read more

[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

[src]

Gets the blend mode to be used when drawing this drawable.

[src]

Draws the drawable onto the rendering target. Read more