SpriteBatch (Français)

SpriteBatch (lot de sprites) utilise une unique image, et en trace un nombre de copies identiques en utilisant un appel à love.graphics.draw(). Peut être utilisé, par exemple pour tracer des copies répétées d'une image de fond unique avec de bonnes performances.

SpriteBatch peut être encore plus utile lorsque l'image sous-jacente est de texture atlas de texture (Une image unique agglomérant différentes images indépendantes) ; en ajoutant des Quad (quadrilatères au lot, différentes images contenues dans l'atlas peuvent être tracées.

Constructeurs

love.graphics.newSpriteBatch Creates a new SpriteBatch.

Fonctions

Object:release Immediately destroys the object's Lua reference. Added since 11.0
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. Added since 11.0
SpriteBatch:addq Adds a Quad to the batch. Removed in 0.9.0
SpriteBatch:attachAttribute Attaches a per-vertex attribute from a Mesh onto this SpriteBatch, for use when drawing. Added since 0.10.0
SpriteBatch:bind Binds the SpriteBatch to memory for more efficient updating. Added since 0.8.0 Removed in 0.10.0
SpriteBatch:clear Removes all sprites from the buffer.
SpriteBatch:flush Immediately sends all new and modified sprite data to the graphics card. Added since 0.9.2
SpriteBatch:getBufferSize Gets the maximum number of sprites the SpriteBatch can hold. Added since 0.9.0
SpriteBatch:getColor Gets the color that will be used for the next add and set operations. Added since 0.9.0
SpriteBatch:getCount Gets the number of sprites currently in the SpriteBatch. Added since 0.9.0
SpriteBatch:getImage Returns the image used by the SpriteBatch. Added since 0.8.0 Removed in 0.10.0
SpriteBatch:getTexture Gets the texture (Image or Canvas) used by the SpriteBatch. Added since 0.9.1
SpriteBatch:set Changes a sprite in the batch. Added since 0.8.0
SpriteBatch:setBufferSize Sets the maximum number of sprites the SpriteBatch can hold. Added since 0.9.0 Removed in 11.0
SpriteBatch:setColor Sets the color that will be used for the next add or set operations. Added since 0.8.0
SpriteBatch:setDrawRange Restricts the drawn sprites in the SpriteBatch to a subset of the total. Added since 11.0
SpriteBatch:setImage Replaces the image used for the sprites. Added since 0.7.2 Removed in 0.10.0
SpriteBatch:setLayer Changes a sprite previously added with add or addLayer, in a batch created with an Array Texture. Added since 11.0
SpriteBatch:setTexture Sets the texture (Image or Canvas) used for the sprites in the batch. Added since 0.9.1
SpriteBatch:setq Changes a sprite with a quad in the batch. Added since 0.8.0 Removed in 0.9.0
SpriteBatch:unbind Unbinds the SpriteBatch. Added since 0.8.0 Removed in 0.10.0

Enums

SpriteBatchUsage Usage hints for SpriteBatches and Meshes. Added since 0.8.0

Supertypes

Voir également


Autres langues