前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >as3翻牌动画

as3翻牌动画

作者头像
meteoric
发布2018-11-16 15:46:16
8920
发布2018-11-16 15:46:16
举报
文章被收录于专栏:游戏杂谈

----------------------------------------------------

主要利用了rotationY属性来进行处理,Pseudocode:

代码语言:javascript
复制
1: import com.greensock.*;

       2: import com.greensock.easing.*;

       3:  

       4: //startValues for the card back

       5: flipper.back.rotationY = -90;

       6: flipper.back.alpha=0;

       7:  

       8: //speed of 90 degrees of flip

       9: var flipSpeed:Number = .5; 

      10:  

      11: //create TimelineMax instance

      12: var tl:TimelineMax = new TimelineMax({paused:true});

      13:  

      14: //flip the front 90 degrees

      15: tl.append(TweenMax.to(flipper.front, flipSpeed, {rotationY:90, visible:false, ease:Linear.easeNone}))

      16:  

      17: //set the back to alpha of 0 as soon as front finishes

      18: tl.append(TweenMax.to(flipper.back, 0, {alpha:1, immediateRender:false}))

      19:  

      20: //flip the back 90 degrees

      21: tl.append(TweenMax.to(flipper.back, flipSpeed, {rotationY:0, ease:Linear.easeNone}))

      22:  

      23: //basic button code

      24: flip1_mc.addEventListener(MouseEvent.CLICK, flip1);

      25:  

      26: function flip1(e:MouseEvent){

      27: // play to the beginning of the timeline

      28:     tl.tweenTo(0);

      29: }

      30:  

      31: flip2_mc.addEventListener(MouseEvent.CLICK, flip2);

      32: function flip2(e:MouseEvent){

      33: // play to the end of the timeline

      34:     tl.tweenTo(tl.duration);

      35: }

参考链接:Easy Breezy 3D Card Flip Effect with Flash, AS3 and Our Good Buddy TimelineMax

本示例下载链接:flipper_new_cs4.zip (需flash cs4+ 才能打开)

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2012-10-15 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档