Is it possible to use several pictures to create an animated picture in pys60?
Is it possible to use several pictures to create an animated picture in pys60?
I could give you code, which crashes in 5 different ways. Just can't figure out timers and without them animation is... pretty fast
In the meanwhile:
Description: you have canvas, but you never draw on it directly in order to avoid flickering. Instead you create an off-screen image and use it as a temporary canvas to prepare screen. When it's ready, you blit it as fast as possible on canvas. This method is called double buffering.
When you get good at that, there's triple buffering. It's a bit more difficult, but gives good results in certain cases.
Between blitting you should have a small pause to let user see what's going on. Eye is slow, that's why movies has 24 frames a second. That's why you don't need to update screen 100 times a second. Also that might be so fast that everything looks like a blur, not good at all.
Btw you want to control that delay between pictures, since you want to have similar results regardless of used device. Your animation should look same in both fast and slow phones.
Canvas is easy, off-screen is easy, blitting is easy. Just can't figure a way to make the pause. Could use a busy-loop, but that would kill battery.
--jouni wondering "TypeError: callable expected for 2nd argument" crash after animation was completed successfully and everything SHOULD be ok...