One thing that is seen all too often in scratch is ugly flashing objects and such. Pen lines are the worst.
Well I've been thinking, and making scratch double buffered would fix this.
For those who do not know, double buffering is when you apply all graphic changes to a memory slot that isn't shown on screen, and then show that slot on screen when all changes have been made. For instance, if you were drawing a real time interactive 3d cube with the pen, rather than having the user see a constant clearing, and then a 0.25 second redraw, they would just see the new image appear every quarter of a second. This could be accomplished with three new blocks:
[Make Graphics Changes Go To Screen]
[Make Graphics Changes Go To Buffer]
[Show Buffer On Screen]
This way, if we want the simple single-buffered scratch we are used to, we just call [Make Graphics Changes Go To Screen] and proceed as usual. But to make a repidly redrawing project, for instance, we would call [Make Graphics Changes Go To Buffer], and then repeatedly redraw our scene, and call [Show Buffer On Screen] at the end of it.
What do you think?
Offline
Yes. I understand your reasoning; but I would suggest another way of doing this.
Currently scratch redraws the screen once per loop or repeat, and forces a short delay.
So in order to draw a bunch at once without flicker and delay, some have stacked many blocks and if statements, and avoided repeats. see 1s1s projects.
(Also what works is to have multiple sprites working at once, although there's not a way to control the order they work.)
So I would like the option to make repeats atomic, (perhaps a small button on the repeat block or hidden right-click option) so the repeat block won't refresh the screen until it's done. But this would make it easy to freeze or lockup the program... so force a refresh after a certain amount of time, and perhaps give a warning?
Last edited by JTxt (2010-10-15 11:27:05)
Offline