最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Following a custom path in TweenJs - Stack Overflow

programmeradmin0浏览0评论

i'm trying to design a simple animation with TweenJs.. Lets consider two people playing throwing ball. I've managed to move the ball in a linear path. But it has to seem realistic. Ball should follow a curvy path like there is gravity.. How can i define "checkpoints" in the path? Or should i change my tactic to achive that goal? Thanks in advance..

i'm trying to design a simple animation with TweenJs.. Lets consider two people playing throwing ball. I've managed to move the ball in a linear path. But it has to seem realistic. Ball should follow a curvy path like there is gravity.. How can i define "checkpoints" in the path? Or should i change my tactic to achive that goal? Thanks in advance..

Share Improve this question asked Mar 11, 2013 at 13:33 DonkeyKongDonkeyKong 8181 gold badge10 silver badges24 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 5

The recently released TweenJS (Version 0.4.0, Feb 12, 2013) contains a MotionGuidePlugin. The usage is pretty simple:


// Using a Motion Guide
createjs.Tween.get(target).to({guide:{ path:[0,0, 0,200,200,200, 200,0,0,0] }},7000);
// Visualizing the line
graphics.moveTo(0,0).curveTo(0,200,200,200).curveTo(200,0,0,0);

Here is a quick fiddle: http://jsfiddle/lannymcnie/qEYD4/1/

More info in the docs. http://www.createjs./Docs/TweenJS/classes/MotionGuidePlugin.html

发布评论

评论列表(0)

  1. 暂无评论