Multitouch squares?

@Andrew_Stacey: where is it documented that Codea uses 3 buffers, and why 3? How do I access each one? Also, the docs say this for backingMode(STANDARD): “[this mode] is the fastest drawing mode and may not preserve the contents of the previously drawn frame”–what does that mean exactly? It’s probabilistic that what you draw shows up? I might be inclined to use it if I could figure out what it really did.

@starblue I never saw where it said Codea uses 3 buffers but @Andrew_Stacey obviously did, or he found it out some other way. And I’m guess why it says it may not preserve the contents of the previously drawn frame is if you tapped for literally one or two frames (not three!), for touching for one frame you would not see it for the other two frames in the buffer, for touching two frames you would not see it on the one other frame in the buffer. Both cases would mean the last drawn image would flicker. Same if you were drawing a sprite at your finger at you moved your finger fast enough. The sprite would only be in one of the three buffers.

I did the experiment. I can’t find my original code, but it basically drew a sequence of ellipses across and down the screen on each frame. It was something like:

function setup()
    r = 20
    x = r
    y = HEIGHT - r
    colours = { color(255,0,0,0), color(0,255,0,0), color(0,0,255,0)}
    n = 1
end

function draw()
    fill(colours[n])
    ellipse(x,y,r)
    x = x + r
    if x >= WIDTH then
        x = r
        y = HEIGHT - r
    end
    n = n%3 + 1
end

Run that and hit pause every now and again.

But don’t if you get migraines

OK, thanks.

@Startblue normaly your are not supposed to access the 3 buffers. This is codea internal stuff only.