Available since LÖVE 0.8.0
This method is not supported in earlier versions.
Changes a sprite in the batch. This requires the identifier returned by add and addq.
SpriteBatch:set( id, x, y, r, sx, sy, ox, oy, kx, ky )
number id
number x
number y
number r (0)
number sx (1)
number sy (sx)
number ox (0)
number oy (0)
number kx (0)
number ky (0)
Nothing.
Available since LÖVE 0.9.0
This variant has replaced SpriteBatch:setq.
Changes a sprite with a Quad in the batch. This requires the identifier returned by SpriteBatch:add.
SpriteBatch:set( id, quad, x, y, r, sx, sy, ox, oy, kx, ky )
number id
Quad quad
number x
number y
number r (0)
number sx (1)
number sy (sx)
number ox (0)
number oy (0)
number kx (0)
number ky (0)
Nothing.
SpriteBatches do not support removing individual sprites. One can do a pseudo removal (instead of clearing and re-adding everything) by:
SpriteBatch:set(id, 0, 0, 0, 0, 0)
This makes all the sprite's vertices equal (because the x and y scales are 0), which prevents the GPU from fully processing the sprite when drawing the SpriteBatch.
© 2006–2016 LÖVE Development Team
Licensed under the GNU Free Documentation License, Version 1.3.
https://love2d.org/wiki/SpriteBatch:set