利用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"});
希望這個範例對大家有所幫助,如果還有疑問,也可以在這邊回應唷~
http://cytpharm.com/# buy cytotec online
Kamagra 100mg
buy hash in prague https://shop-cannabis-prague.com
http://dappharm.com/# dap pharm
prednisone steroids
An alternative investment is any investment other than the three traditional asset classes: stocks, bonds and cash.
The intellectual property rights are owned by Netflix.
PredPharm: can you buy prednisone over the counter in canada – prednisone 10 mg coupon
buy thc chocolate in prague https://shop-cannabis-prague.com
посмотреть в этом разделе GAMA
thc weed in prague buy thc vape in prague
Abortion pills online: Cyt Pharm – п»їcytotec pills online
PredPharm: where to buy prednisone 20mg no prescription – PredPharm
https://cytpharm.com/# cytotec buy online usa
prednisone 5443
https://predpharm.com/# prednisone buy
Kamagra 100mg price
Place the brush with the bottom bristles dealing with the route by which your hand is shifting, so you are working with the movement of the brush and not towards it.
купить диплом в южно сахалинске
buy kamagra online usa Kama Pharm Kama Pharm
Для комфортного сна рекомендую этот магазин постельного белья, смотрите тут https://anotepad.com/note/read/4f8ffqbn
https://kamapharm.shop/# sildenafil oral jelly 100mg kamagra
prednisone generic brand name
Kama Pharm: Kama Pharm – Kama Pharm
Pretty! This has been a really wonderful article. Thanks for providing these details.
semaglutide tablets store [url=https://semapharm24.shop/#]generic rybelsus tabs[/url] rybelsus semaglutide tablets
Nonetheless, setting your trades and investments within the wrong place, buying or selling on the wrong time and not figuring out when traits change may be detrimental.
Предлагаем услуги профессиональных инженеров офицальной мастерской.
Еслли вы искали ремонт фотоаппаратов canon, можете посмотреть на сайте: срочный ремонт фотоаппаратов canon
Наши мастера оперативно устранят неисправности вашего устройства в сервисе или с выездом на дом!
Платформа Курьер Купер https://cash-kuper.ru открывает возможности для работы в доставке. Свободный график, прозрачная система оплаты и заказы поблизости – идеальный выбор для тех, кто ищет подработку или основной заработок.
SemaPharm24 SemaPharm24 cheap semaglutide pills
http://cytpharm.com/# CytPharm
3000mg prednisone
Perhaps the primarily necessary level to bear in mind when discussing money contracts and the market is that every time a contract is obtainable to a producer, any individual is making that settlement available through the use of the market.
https://cytpharm.com/# CytPharm
Kamagra 100mg price
Pred Pharm: 40 mg daily prednisone – prednisone 20 tablet
https://kamapharm.shop/# Kama Pharm
Kamagra 100mg price