Forum Discussion
renojim
15 years agoCommunity Streaming Expert
"kbenson" wrote:
Are you using multiple canvas objects? From what I remember, I haven't had any problems with this on a single canvas, but multiple canvas items require you to call .show() on the back ones first (with a small delay between them), otherwise the back canvas can't refresh and wipe out any drawing that happened on top of it.
I copied this from greubel's thead since I didn't want to hijack it.
I tried this for an animation, but calling .show() on the back one causes a sort of flashing as the object I'm trying to move across the screen disappears completely during the small delay and then reappears when I call .show() on its canvas. Is this as good as I can expect, or am I missing something? Also, it looks like the box isn't too happy about me calling show() on two different canvases 100 times a second - when I press Home it takes a few seconds for the main screen to appear.
I did lots of experimenting last night, but I wasn't real happy with anything I tried and several things I tried had really strange results. The best compromise I found was to have a background canvas and another canvas where the animation takes place. Then when I want to move the object across the screen, I redraw it in the background color at its old position and at the same time draw it at its new position. This only works because my animation is really simple, my background is mostly empty, and the few places where the moving image crosses over something on the background I can handle pretty easily. It mostly works, but there are still strange things happening on these canvasses. If I don't put enough of a delay in the loop it looks like some updates get discarded leaving artifacts on the screen. Pressing a button on the remote sometimes has the same effect.
That gradient idea sounds pretty cool. I'm going to have to use that someplace. Thanks for sharing!
-JT