love2d / love

LÖVE is an awesome 2D game framework for Lua.
https://love2d.org
Other
5.06k stars 400 forks source link

spriteBatch:setBufferSize() is nil #1409

Closed slime73 closed 6 years ago

slime73 commented 6 years ago

Original report by . (Bitbucket: dragonfan, GitHub: dragonfan).


Code I used to reproduce:

#!Lua

function love.load()
    local needed = love.image.newImageData(200,200)
    local batchie = love.graphics.newSpriteBatch(love.graphics.newImage(needed),1000,"stream")
    batchie:setBufferSize(1000)
end

Error message:

Error

main.lua:4: attempt to call method 'setBufferSize' (a nil value)

Traceback

main.lua:4: in function 'load'
[C]: in function 'xpcall'
[C]: in function 'xpcall'
slime73 commented 6 years ago

Original comment by Alex Szpakowski (Bitbucket: slime73, GitHub: slime73).


The function was removed since SpriteBatches now automatically get bigger when they run out of space (similarly to Text objects), I forgot to document it though – I just updated the wiki with information about that.