Log scales = animation scales?

David Bovill david at openpartnership.net
Sun Jul 15 06:29:09 EDT 2007


Great - that will do the trick Scott!

I think it would be good to separate the number series generated from the
action - so that you could animate various properties not just the loc, and
also it may have a very minor speed benefit at the cost of slower start.
>From a couple of tests you can't fluidly animate more than a very small
number of objects at the same time. So generating a lista and passing that
recursively deleting an item each pass may help a little.

NB - how does RunRev compare performance wise in animating simple controls
compared to Flash - I know Flash has a lot of nice features and s set up for
this - but if you just want to animate a button across the screen, or as i
my case a few pieces of text in fields (changeing there size)... is Flash
any faster?

On 15/07/07, Scott Rossi <scott at tactilemedia.com> wrote:
>
> Recently, David Bovill wrote:
>
> > Are there any ideas for natural type movements - straight acceleration
> > (maybe with ease in and / or ease out)?
>
> You're welcome to use the following (watch wraps).  It's set up as a
> handler
> with parameters to allow for easing (moving) multiple objects at once.  So
> you can place the code in the card script, for example, and call
> "easeObject..." for each object on the card you want to move.
> (Requires Rev 2.7 or later for object fading.)
>
> # EASE IN/OUT ANIMATION SCRIPT
> #
> # VARIABLE DESCRIPTIONS
> # pObj = LONG ID OF OBJECT TO MOVE
> # pStartLoc = STARTING LOCATION
> # pDestLoc = ENDING LOCATION
> # pMethod = "IN" OR "OUT" -- "IN" DECELERATES, "OUT" ACCELLERTATES
> # pDuration = DURATION OF EASE EFFECT
> # pStartTime = TIME IN MILLISECONDS WHEN EASE EFFECT BEGINS
> # pFade = "IN" OR "OUT" -- OPTIONAL FADE IN/OUT OF EASED OBJECT
> # pHost = LONG ID OF OBJECT TO RECEIVE 'EASEDONE' MESSAGE
>
> on easeObject
> pObj,pStartLoc,pDestLoc,pMethod,pDuration,pStartTime,pFade,pHost
>   put (the millisecs - pStartTime)/pDuration into phi
>   # REQUIRED FOR SHORT MOVE TIMES
>   if phi > 1 then put 1 into phi
>   # USE APPROPRIATE FUNCTION
>   if pMethod = "in" then put (2*phi - phi^2) into tEase # EASE IN
>   if pMethod = "out" then put phi^2 into tEase # EASE OUT
>   # MOVE OBJECT
>   put (item 1 of pDestLoc - item 1 of pStartLoc) into xDist
>   put (item 2 of pDestLoc - item 2 of pStartLoc) into yDist
>   put item 1 of pStartLoc + round(tEase * xDist) into newX
>   put item 2 of pStartLoc + round(tEase * yDist) into newY
>   set loc of pObj to newX,newY
>   if pFade = "in" then set blendLevel of pObj to 100 - (phi * 100)
>   if pFade = "out" then set blendLevel of pObj to (phi * 100)
>   # EXIT WHEN OBJECT REACHES ITS DESTINATION
>   if ((newX,newY) = pDestLoc) or (phi >= 1) then
>     send "easeDone pObj" to pHost
>     exit easeObject
>   end if
>   # LOOP SCRIPT
>   send "easeObject
> pObj,pStartLoc,pDestLoc,pMethod,pDuration,pStartTime,pFade,pHost" to me in
> 10 milliseconds
> end easeObject
>
>
> Regards,
>
> Scott Rossi
> Creative Director
> Tactile Media, Multimedia & Design
>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>



More information about the Use-livecode mailing list