Page 2 of 2
Re: LÖVE 2D for everything.
Posted: Sat Feb 28, 2015 10:17 pm
by Robin
If you actually want a static frame, it's probably best to override love.run in such a way that love.draw() draws to a canvas, and then have a loop that just draws the canvas and sleeps for a fraction of a second.
If you rely on just drawing once and then doing nothing... well... do you remember when an application in Windows 98* was unresponsive? And you have a window belonging to another application, and you move it around, and it draws over the unresponsive application until nothing is left?
Yeah, you'll likely get that effect if you draw to the screen only once.
* It's been a long time since I last used Windows intensively, so I don't remember if the situation has changed since then.
Re: LÖVE 2D for everything.
Posted: Sun Mar 01, 2015 7:55 am
by Jasoco
Robin wrote:* It's been a long time since I last used Windows intensively, so I don't remember if the situation has changed since then.
I don't use Windows all the time either but I don't think this has happened since the 95-XP days. I believe with Vista/7 they rewrote their window server to work more smoothly like OS X, but don't quote me on it. Either way, that's not the point Robin was getting at. This is what he was talking about...
This is a result of the window server drawing the window every frame, but not clearing the buffer every frame. So if you drag the window around it just keeps painting the screen with the new location. In Löve you can do this if you keep drawing to a Canvas but don't call
canvas:clear(). Not that this clump of text matters. The whole point was to Google for and post that image.
And this image.
And I can turn those into links if I need to. lol They're so huge.
Re: LÖVE 2D for everything.
Posted: Thu Mar 05, 2015 6:30 pm
by Bereb
S0lll0s wrote:[you could either overwrite love.run or quit at the end of love.draw. (first is cleaner probably)
First, thanks for the suggestions. I already used this trick for an animation script. I wished to prevent the automatic 'love.graphics.clear' in 'run.lua', so as to manage it in my script. And that works indeed!
Re: LÖVE 2D for everything.
Posted: Thu Mar 05, 2015 6:32 pm
by Bereb
zorg wrote:well, if one wants the game to actually not-quit, but show that one frame forever, then one could do all processing in love.load, then display in love.draw; since nothing's updating, what gets drawn will be static... or just comment the while loop in love.run.
Thanks for the advice.
I didn't yet really try it. But I think 'love.draw' is constantly "looping" even though (but maybe because of 'love.timer'? I don't know)