From: Ray C. <rc...@gm...> - 2006-09-04 11:14:32
|
Hi, I've made some changes to NSAnimation and related classes. There are now 2 main classes to use: ASAnimation and NSAnimation. No, that's not a typo, there are 2 such classes. What ASAnimation does is allow the delegate with the method animationDidAdvance, which is not part of the Cocoa specs. This is an alternative to what Apple recommends: subclassing NSAnimation and overriding the setCurrentProgress method. I find this too cumbersome, so the framework now contains ASAnimation which saves you the trouble of subclassing NSAnimation. I've also added more constants to NSAnimationCurve and removed methods like setBegin/setChange such that full Cocoa-spec compliance is ensured in NSAnimation. See /trunk/test/org.actionstep.test.ASTestAnimation for an example. To animate in the RP(Robert Penner)-style, you would do this previously: >>> anim.setBegin(sx); anim.setChange(dx); anim.setFrameRate(30); anim.setDelegate({ animationDidAdvance:function(foo:NSAnimation):Void { mc._x = foo.currentValue(); } }); <<< Now you to do the same thing, you will do: >>> // no more setBegin/Change anim.setFrameRate(1/30); //note change in frame rate anim.setDelegate({ animationDidAdvance:function(foo:NSAnimation):Void { mc._x = sx + foo.currentValue() * dx; } }); <<< -currentValue is always between 0 and 1, so you can think of it as a fraction of the value to animate. Do not confuse this with -currentProgress which tells you how much of the animation has completed. -- Cheers, Ray Chuan |
From: Zaba Z. <se...@gm...> - 2006-09-04 11:20:52
|
sx? dx? im not familiar with AS-animations at all, can you explain? Also, toes the framework itself use animation? will the code be updated then? On 9/4/06, Ray Chuan <rc...@gm...> wrote: > > Hi, > I've made some changes to NSAnimation and related classes. > > There are now 2 main classes to use: ASAnimation and NSAnimation. No, > that's not a typo, there are 2 such classes. What ASAnimation does is > allow the delegate with the method animationDidAdvance, which is not > part of the Cocoa specs. > > This is an alternative to what Apple recommends: subclassing > NSAnimation and overriding the setCurrentProgress method. I find this > too cumbersome, so the framework now contains ASAnimation which saves > you the trouble of subclassing NSAnimation. > > I've also added more constants to NSAnimationCurve and removed methods > like setBegin/setChange such that full Cocoa-spec compliance is > ensured in NSAnimation. > > See /trunk/test/org.actionstep.test.ASTestAnimation for an example. > > To animate in the RP(Robert Penner)-style, you would do this previously: > >>> > anim.setBegin(sx); > anim.setChange(dx); > anim.setFrameRate(30); > anim.setDelegate({ > animationDidAdvance:function(foo:NSAnimation):Void { > mc._x = foo.currentValue(); > } > }); > <<< > Now you to do the same thing, you will do: > >>> > // no more setBegin/Change > anim.setFrameRate(1/30); //note change in frame rate > anim.setDelegate({ > animationDidAdvance:function(foo:NSAnimation):Void { > mc._x = sx + foo.currentValue() * dx; > } > }); > <<< > > -currentValue is always between 0 and 1, so you can think of it as a > fraction of the value to animate. Do not confuse this with > -currentProgress which tells you how much of the animation has > completed. > > -- > Cheers, > Ray Chuan > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job > easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > actionstep-core mailing list > act...@li... > https://lists.sourceforge.net/lists/listinfo/actionstep-core > -- Zaba "...The question it NOT why you should migrate to Linux, but WHY NOT?..." Open Source forever! http://gnu.org -- http://www.linux.org -- http://kde.org That's not all! |
From: Ray C. <rc...@gm...> - 2006-09-04 13:58:26
|
Hi, On 9/4/06, Zaba Zabov <se...@gm...> wrote: > sx? dx? im not familiar with AS-animations at all, can you explain? Please see the "Animation Programming Guide for Cocoa": http://developer.apple.com/documentation/Cocoa/Conceptual/AnimationGuide/index.html#//apple_ref/doc/uid/TP40003592 > Also, toes the framework itself use animation? will the code be updated > then? Yes it will. > > > On 9/4/06, Ray Chuan <rc...@gm...> wrote: > > > Hi, > I've made some changes to NSAnimation and related classes. > > There are now 2 main classes to use: ASAnimation and NSAnimation. No, > that's not a typo, there are 2 such classes. What ASAnimation does is > allow the delegate with the method animationDidAdvance, which is not > part of the Cocoa specs. > > This is an alternative to what Apple recommends: subclassing > NSAnimation and overriding the setCurrentProgress method. I find this > too cumbersome, so the framework now contains ASAnimation which saves > you the trouble of subclassing NSAnimation. > > I've also added more constants to NSAnimationCurve and removed methods > like setBegin/setChange such that full Cocoa-spec compliance is > ensured in NSAnimation. > > See /trunk/test/org.actionstep.test.ASTestAnimation for an > example. > > To animate in the RP(Robert Penner)-style, you would do this previously: > >>> > anim.setBegin(sx); > anim.setChange(dx); > anim.setFrameRate (30); > anim.setDelegate({ > animationDidAdvance:function(foo:NSAnimation):Void { > mc._x = foo.currentValue(); > } > }); > <<< > Now you to do the same thing, you will do: > >>> > // no more setBegin/Change > anim.setFrameRate(1/30); //note change in frame rate > anim.setDelegate({ > animationDidAdvance:function(foo:NSAnimation):Void { > mc._x = sx + foo.currentValue() * dx; > } > }); > <<< > > -currentValue is always between 0 and 1, so you can think of it as a > fraction of the value to animate. Do not confuse this with > -currentProgress which tells you how much of the animation has > completed. > > -- > Cheers, > Ray Chuan > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job > easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > actionstep-core mailing list > act...@li... > https://lists.sourceforge.net/lists/listinfo/actionstep-core > > > > -- > Zaba > > "...The question it NOT why you should migrate to Linux, but WHY NOT?..." > > Open Source forever! > http://gnu.org -- http://www.linux.org -- http://kde.org > That's not all! > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job > easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > > _______________________________________________ > actionstep-core mailing list > act...@li... > https://lists.sourceforge.net/lists/listinfo/actionstep-core > > > -- Cheers, Ray Chuan |