利用Tweener製作動畫 – 貝茲曲線
在看過前面一篇Tweener基礎篇之後,應該會發現我們的動畫元件雖然可以依照不同的模式移動,但是在路徑上還依然是保持直線移動,而這一篇文章就要來示範如何讓元件利用貝茲曲線來產生移動路徑,至於甚麼是貝茲曲線?大家可以參考維基百科上面的說明,這邊就不贅述了。
在Tweener的官方網站裡有提供一個貝茲曲線產生器的Flash動畫讓大家下載,不過由於官方示範這個貝茲曲線產生器所使用的是舊版本的Tweener Class,所以在程式碼範例上有些缺失,馬老師這邊提供我修改過且進行中文化後的範例供大家下載
範例中Add Bezier Point是增加節點,Remove Point是刪除節點,利用這些功能並拖曳上面的範例曲線,就可以製作出你想要移動的路徑,接下來請先把「需要先被匯入與執行的Tweener」三行指令放置在程式碼的最前面,接著再把「Tweener動畫指令」貼上即可!這樣一來以後連製作這樣的路徑也會變得很方便了!
整個動畫的程式碼如下,也提供利用此效果製作的動畫檔給大家參考:
import caurina.transitions.Tweener import caurina.transitions.properties.CurveModifiers CurveModifiers.init() Tweener.addTween(ball, {x:475, y:80, _bezier:[{x:150, y:43}, {x:71, y:206.5}], time:1, transition:"linear"});
希望這個範例對大家有所幫助,如果還有疑問,也可以在這邊回應唷~
can you buy pregabalin where can i buy generic pregabalin for sale where buy generic pregabalin without a prescription
Have you given any kind of thought at all with converting your current web-site into French? I know a couple of of translaters here that will would certainly help you do it for no cost if you want to get in touch with me personally.
I truly appreciate this post. I have been looking everywhere for this! Thank goodness I found it on Bing. You have made my day! Thank you again
cheap pregabalin online how to buy pregabalin where can i get generic pregabalin tablets
Hello ! I am the one who writes posts on these topics baccaratsite I would like to write an article based on your article. When can I ask for a review?
If you don’t mind, where do you host your weblog? I am looking for a very good web host and your webpage seams to be extremely fast and up most the time…
I had fun reading this post. I want to see more on this subject.. Gives Thanks for writing this nice article.. Anyway, I’m going to subscribe to your rss and I wish you write great articles again soon.
I’ve been surfing online more than 3 hours today, yet I never found any interesting article like yours. It’s pretty worth enough for me. In my view, if all web owners and bloggers made good content as you did, the net will be much more useful than ever before.
This site all known killa snus very good and trust!
I thought it was going to be some boring old post, but I’m glad I visited. I will post a link to this site on my blog. I am sure my visitors will find that very useful.
https://datingtopreview.com/# dating for free
hey thanks for the info. appreciate the good work
purchase lyrica generic order lyrica 75 mg online pregabalin over the counter
This site all known KILLA FLASH 4mg very good and trust!
Отличный хирург! сойфер владимир отзывы рекомендую зайти на сайт и ознакомиться с отзывами!
buy lyrica 150 mg pills can i buy generic pregabalin price order pregabalin 150 mg pill
Отличный хирург! владимир сойфер отзывы рекомендую зайти на сайт и ознакомиться с отзывами!
Отличный хирург! сойфер владимир валерьевич отзывы рекомендую зайти на сайт и ознакомиться с отзывами!
On this site buy pouches all known killa snus very good and trust taste!
Отличный хирург! сойфер владимир отзывы рекомендую зайти на сайт и ознакомиться с отзывами!
buy generic pregabalin without a prescription cost lyrica prices can i buy lyrica without rx
IFH Newsletter Q4 2020 cheapest cialis online The effects of estrogen are mediated by three types of receptors ERs, ERО±, ERОІ, and G protein coupled receptor GPER 75, 100