Module ggez::graphics::spritebatch[][src]

Expand description

A SpriteBatch is a way to efficiently draw a large number of copies of the same image, or part of the same image. It’s useful for implementing tiled maps, spritesheets, particles, and other such things.

Essentially this uses a technique called “instancing” to queue up a large amount of location/position data in a buffer, then feed it to the graphics card all in one go.

Also it’s super slow in rustc’s default debug mode, because rustc adds a lot of checking to the vector accesses and math. If you use it, it’s recommended to crank up the opt-level for debug mode in your game’s Cargo.toml.

Structs

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

An index of a particular sprite in a SpriteBatch.