Subject: | Re: Animation code
| Date: | 28 May 2020 19:10:00 -0400
| From: | "Kevin Zawicki" <numberjack@wi.rr.com>
| Newsgroups: | pnews.paradox-programming
|
switches are fast, but lets say you have 100 cases, it takes longer to get
to case 100 than case 1 as it sequentially tests each case. Probably not
notice it unless tracking time or need 1000 cases...
If you have 360 bitmaps to rotate 1 degree, the switch is not practical.
You could (pseudo code not tested, a few ways to go here)
----
cnt smallInt on the form
mx smalInt
cnt = 2 ;cnt is the next bit, starts with 1 visible
mx = 12 ;// can even make dynamic
- on the timer -
var
ui uiObject
endvar
;//if last one make first one
ui.attach("bit" + string( iif(cnt = mx,1,cnt+1) ))
ui.visible = true ;//turns next one on to prevent blinking
;// stack them in order
cnt = cnt + 1
if cnt = 13 then cnt = 1 endif
ui.attach("bit" + cnt string())
ui.visible = false ;//turns current on off
------
you can also use bringToFront() and keep them all visible moving to front
the one you need (I think I have done that)
Kevin Baker <shcsbaker@gmail.com> wrote:
>
>On the attached jpg, as you can see I have 4 boxes, with with a green
>box that starts the animation. I of course stack these bitmaps on top
>of each other with the timer set to 100.
>
>My question: Is using the switch the best way to do this? It works
>great and looks great, but didn't know if there were any unseen issues
>with doing an animation like this.
>
>Thanks,
>Kevin
>
|