Struct ggez::graphics::spritebatch::SpriteBatch[][src]

pub struct SpriteBatch { /* fields omitted */ }

A SpriteBatch draws a number of copies of the same image, using a single draw call.

This is generally faster than drawing the same sprite with many invocations of draw(), though it has a bit of overhead to set up the batch. This makes it run very slowly in Debug mode because it spends a lot of time on array bounds checking and un-optimized math; you need to build with optimizations enabled to really get the speed boost.

Methods

impl SpriteBatch
[src]

Creates a new SpriteBatch, drawing with the given image.

Takes ownership of the Image, but cloning an Image is cheap since they have an internal Arc containing the actual image data.

Adds a new sprite to the sprite batch.

Returns a handle with which type to modify the sprite using set()

Alters a sprite in the batch to use the given draw params

Removes all data from the sprite batch.

Unwraps the contained Image

Replaces the contained Image, returning the old one.

Get the filter mode for the SpriteBatch.

Set the filter mode for the SpriteBatch.

Deprecated

Create an object which draws the current sprite batch with a different image.

Trait Implementations

impl Debug for SpriteBatch
[src]

Formats the value using the given formatter. Read more

impl Clone for SpriteBatch
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl PartialEq for SpriteBatch
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Drawable for SpriteBatch
[src]

Actually draws the object to the screen. Read more

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

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

Draws the drawable onto the rendering target. Read more

Auto Trait Implementations

impl Send for SpriteBatch

impl Sync for SpriteBatch