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.
LÖVE 2D for everything.
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: LÖVE 2D for everything.
Help us help you: attach a .love.
- Jasoco
- Inner party member
- Posts: 3727
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: LÖVE 2D for everything.
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...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.
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.
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!S0lll0s wrote:[you could either overwrite love.run or quit at the end of love.draw. (first is cleaner probably)
Last edited by Bereb on Fri May 01, 2015 5:13 pm, edited 1 time in total.
Re: LÖVE 2D for everything.
Thanks for the advice.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.
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)
Who is online
Users browsing this forum: Google [Bot] and 3 guests