Computer Science Canada need help with simple animation |
Author: | Hendo [ Mon Feb 26, 2007 10:18 am ] | ||
Post subject: | need help with simple animation | ||
i use this code to draw a basic looking animated cloud.
what this does though is leave a big trail behind it. I know I either have to redraw everything that is not animated or do something else to fix this. It works if i redraw the rest of the "non-animated" parts but it goes really slow...just wondering if there is a better way? |
Author: | Reality Check [ Mon Feb 26, 2007 3:24 pm ] | ||||
Post subject: | Re: need help with simple animation | ||||
First things first. I have no idea why you have all of those draws. All you need is one since your program loops and re-draws according to new values. Secondly, when using View.Update, accompany it with a setscreen ("offscreenonly"). This means that is does the calculations OFF the screen and updates the new one. This prevents flickering. Finally, you were missing a cls to clear your old picture. Here is your fixed up code.
|
Author: | Hendo [ Tue Feb 27, 2007 9:15 am ] |
Post subject: | Re: need help with simple animation |
i don't know about you, but my clouds usually look like more than 1 circle (hence why I have all those Draw.Ovals) I have other things in the picture besides the cloud and using cls erases all of it. It's an assignment for school and I'm making a scenery. |
Author: | HellblazerX [ Tue Feb 27, 2007 1:58 pm ] |
Post subject: | RE:need help with simple animation |
Well, when you redraw the "non-animated" parts, the background, I'm assuming you're drawing them all separately, so what you could do is draw your background once, and save it as a picture using Pic.New, and redraw that one picture everytime instead of cls. That would be faster than redrawing everything separately. |
Author: | Reality Check [ Tue Feb 27, 2007 8:42 pm ] |
Post subject: | Re: need help with simple animation |
Oh sorry. I didn't read the part that said cloud. I should read questions ![]() |
Author: | Hendo [ Wed Feb 28, 2007 7:49 am ] |
Post subject: | Re: RE:need help with simple animation |
HellblazerX @ Tue Feb 27, 2007 1:58 pm wrote: Well, when you redraw the "non-animated" parts, the background, I'm assuming you're drawing them all separately, so what you could do is draw your background once, and save it as a picture using Pic.New, and redraw that one picture everytime instead of cls. That would be faster than redrawing everything separately.
hey, thats a good idea...i figured out the reason it was working so slow was just the computer i was using...i tried a different computer in the lab and it worked fine, i just put everything that wasn't animated into a procedure....but using Pic.New is probably even faster than that. Thanks ![]() |