Hi all, I'm using LÖVE (simply amazing fw by the way, I LÖVE it ) in some kind of object oriented approach, implemented in Lua by use of metatables as described in lua-users.org tutorials. I have some independent objects on screen, every object has (as it's class dictates) a draw() method and an update() method. The question is, Do I have to control when to redraw things by myself? or the 'draw' callback does that for me. I've read the documentation about draw callback and didn't find anything like:
I'm not sure if I fully understand your question, nor do I know if this is proper or not, but I think you have two options:
Just have the needsRedraw return a bool on it's ready-to-redraw state and do the actual drawing within the draw callback function.
Have the full redraw logic be self-contained with the object and simply iterate through your objects in the draw callback and let the objects worry about whether or not they need to redraw or not, and if so, just let them do it themselves.
Does that make sense? From what I understand, yes, you're free to dictate the drawing of objects as you wish. The draw callback is there just to give you a nice location for organizing all your draw logic. I suppose you could also do all your drawing in the update callback if you really wanted.