This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2010-10-14 23:14:14

billyedward
Scratcher
Registered: 2008-01-03
Posts: 500+

A double-Buffered Scratch

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?


"I'd love to change the world, but they haven't released the source code yet."
Check out the latest version of Streak --> http://billy.scienceontheweb.net/Streak

Offline

 

#2 2010-10-14 23:24:12

bbbeb
Scratcher
Registered: 2009-06-11
Posts: 1000+

Re: A double-Buffered Scratch

That would confuse the newer people.


Back in my day.... there were no laws that censored the internet... now, there are.... nah.

Offline

 

#3 2010-10-14 23:40:51

kayybee
Scratcher
Registered: 2009-12-07
Posts: 1000+

Re: A double-Buffered Scratch

Huh? It would confuse normal scratchers too... but then again, it would just be like other blocks, like the trig blocks that I never use.

Offline

 

#4 2010-10-15 11:22:39

JTxt
Scratcher
Registered: 2010-05-19
Posts: 100+

Re: A double-Buffered Scratch

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)


http://scratch.mit.edu/static/icons/buddy/524717_med.png?t=2010-06-15+09%3A48%3A36

Offline

 

Board footer