SpriteBatch
Using a single image, draw any number of identical copies of the image using a single call to love.graphics.draw(). This can be used, for example, to draw repeating copies of a single background image.
A SpriteBatch can be even more useful when the underlying image is a Texture Atlas (a single image file containing many independent images); by adding Quads to the batch, different sub-images from within the atlas can be drawn.
Constructors
love.graphics.newSpriteBatch | Creates a new SpriteBatch. |
Functions
Object:release | Immediately destroys the object's Lua reference. |
Object:type | Gets the type of the object as a string. |
Object:typeOf | Checks whether an object is of a certain type. |
SpriteBatch:add | Adds a sprite to the batch. |
SpriteBatch:addLayer | Adds a sprite to a batch created with an Array Texture. |
SpriteBatch:addq | Adds a Quad to the batch. |
SpriteBatch:attachAttribute | Attaches a per-vertex attribute from a Mesh onto this SpriteBatch, for use when drawing. |
SpriteBatch:bind | Binds the SpriteBatch to memory for more efficient updating. |
SpriteBatch:clear | Removes all sprites from the buffer. |
SpriteBatch:flush | Immediately sends all new and modified sprite data to the graphics card. |
SpriteBatch:getBufferSize | Gets the maximum number of sprites the SpriteBatch can hold. |
SpriteBatch:getColor | Gets the color that will be used for the next add and set operations. |
SpriteBatch:getCount | Gets the number of sprites currently in the SpriteBatch. |
SpriteBatch:getImage | Returns the image used by the SpriteBatch. |
SpriteBatch:getTexture | Gets the texture (Image or Canvas) used by the SpriteBatch. |
SpriteBatch:set | Changes a sprite in the batch. |
SpriteBatch:setBufferSize | Sets the maximum number of sprites the SpriteBatch can hold. |
SpriteBatch:setColor | Sets the color that will be used for the next add or set operations. |
SpriteBatch:setDrawRange | Restricts the drawn sprites in the SpriteBatch to a subset of the total. |
SpriteBatch:setImage | Replaces the image used for the sprites. |
SpriteBatch:setLayer | Changes a sprite previously added with add or addLayer, in a batch created with an Array Texture. |
SpriteBatch:setTexture | Sets the texture (Image or Canvas) used for the sprites in the batch. |
SpriteBatch:setq | Changes a sprite with a quad in the batch. |
SpriteBatch:unbind | Unbinds the SpriteBatch. |
Supertypes
See Also
Other Languages
Dansk –
Deutsch –
English –
Español –
Français –
Indonesia –
Italiano –
Lietuviškai –
Magyar –
Nederlands –
Polski –
Português –
Română –
Slovenský –
Suomi –
Svenska –
Türkçe –
Česky –
Ελληνικά –
Български –
Русский –
Српски –
Українська –
עברית –
ไทย –
日本語 –
正體中文 –
简体中文 –
Tiếng Việt –
한국어
More info