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 with high performance.

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.newSpriteBatchCreates a new SpriteBatch.

Functions

Object:typeGets the type of the object as a string.
Object:typeOfChecks whether an object is of a certain type.
SpriteBatch:addAdds a sprite to the batch.
SpriteBatch:addqAdds a Quad to the batch. Removed in 0.9.0
SpriteBatch:bindBinds the SpriteBatch to memory for more efficient updating.Added since 0.8.0
SpriteBatch:clearRemoves all sprites from the buffer.
SpriteBatch:getBufferSizeGets the maximum number of sprites the SpriteBatch can hold.Added since 0.9.0
SpriteBatch:getColorGets the color that will be used for the next add and set operations.Added since 0.9.0
SpriteBatch:getCountGets the number of sprites currently in the SpriteBatch.Added since 0.9.0
SpriteBatch:getImageReturns the image used by the SpriteBatch.Added since 0.8.0
SpriteBatch:getTextureGets the texture (Image or Canvas) used by the SpriteBatch.Added since 0.9.1
SpriteBatch:setChanges a sprite in the batch.Added since 0.8.0
SpriteBatch:setBufferSizeSets the maximum number of sprites the SpriteBatch can hold.Added since 0.9.0
SpriteBatch:setColorSets the color that will be used for the next add or set operations.Added since 0.8.0
SpriteBatch:setImageReplaces the image used for the sprites.Added since 0.7.2
SpriteBatch:setTextureSets the texture (Image or Canvas) used for the sprites in the batch.Added since 0.9.1
SpriteBatch:setqChanges a sprite with a quad in the batch.Added since 0.8.0 Removed in 0.9.0
SpriteBatch:unbindUnbinds the SpriteBatch.Added since 0.8.0

Enums

SpriteBatchUsageUsage hints for SpriteBatches.Added since 0.8.0

Supertypes

See Also


Other Languages

Personal tools