How did it work out for you? Were you able to make use of it enough to justify keeping it? I'd love to make it a real library but I'm sure it's got some non-standard coding methods. Maybe I could post it somewhere and get suggestions for how to make it official enough. Only if enough people are interested. I mean it's nothing no one can do. It's just putting values in a numbered table, sorting that table by a specific value, then running through the sorted table and drawing objects based on the values in each row. You don't necessarily need a library to do it, but I made it so it can be reusable and usable multiple times in the same project. (Basically you could have multiple DrawPools and draw different things to each if you need to. Like game elements in one and UI elements in another. It's just a convenience really.Davidobot wrote:Btw guys, I was the one Jasoco shared his DrawPool library with.
So is anyone going to say anything about the video itself?
Code: Select all
drawPool = love.filesystem.load("drawPool.lua")()
-- Using require doesn't work with the method I use right now. But that could be fixed.
function love.draw()
drawPool:prepare()
for (all objects in game that need to be drawn) do
...
drawPool:push {} -- All the parameters for the drawables will be pushed during this example loop.
...
end
drawPool:push {}
-- optionally some other non-game elements or other stuff.
-- It doesn't matter if they're being put in the same drawPool.
-- All that matters is the layer. As long as :push() calls are only called between :prepare() and :present().
drawPool:present()
end