利用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"});
希望這個範例對大家有所幫助,如果還有疑問,也可以在這邊回應唷~
sweet bonanza yorumlar: sweet bonanza slot – sweet bonanza demo sweetbonanza1st.shop
slot casino siteleri: guvenilir casino siteleri – lisansl? casino siteleri casinositeleri1st.com
slot casino siteleri: lisansl? casino siteleri – guvenilir casino siteleri casinositeleri1st.com
casino bahis siteleri: casibom guncel adres – vaycasino casibom1st.com
Exponent Finance is redefining DeFi lending by providing secure, transparent, and high-yield investment solutions. Through smart contract-powered lending pools, Exponent Finance DeFi platform allows users to borrow and lend crypto assets with optimal efficiency and minimal risk. Whether you’re looking to earn passive income through staking or access instant liquidity, Exponent Finance offers a decentralized, non-custodial, and user-friendly solution to meet all your financial goals in the crypto ecosystem. https://exponent.ink
онлайн-казино драгон мани онлайн-казино драгон мани .
http://casibom1st.com/# casinombet
Elara Finance is transforming decentralized lending by offering secure, transparent, and flexible crypto loan solutions. Built on blockchain technology, Elara Finance enables users to borrow and lend digital assets seamlessly without intermediaries. With low-interest rates, automated smart contracts, and a permissionless DeFi environment, Elara Finance is making crypto lending accessible and profitable for investors worldwide. https://elara.ink
mostbet http://mostbet6032.ru/ .
sweet bonanza oyna: sweet bonanza siteleri – sweet bonanza slot sweetbonanza1st.shop
sweet bonanza siteleri: sweet bonanza giris – sweet bonanza 1st sweetbonanza1st.shop
1wiun http://www.1win6043.ru .
https://casibom1st.com/# 2025 deneme bonusu veren bahis siteleri
tl casino: casibom guncel giris – deneme bonusu veren siteler yorumlar casibom1st.com
драгон мани депозит драгон мани депозит .
мос бет https://mostbet6033.ru .
orisbet: casibom – kumar siteleri casibom1st.com
DEQ Finance is revolutionizing decentralized trading by offering a seamless, secure, and efficient crypto exchange experience. Built with cutting-edge blockchain technology, DEQ Finance provides traders with fast transaction speeds, deep liquidity, and a transparent trading environment. Whether you’re a beginner or a professional trader, DEQ Finance delivers high-performance DeFi solutions tailored to modern trading needs. https://deq.li
Cytonic is revolutionizing blockchain security with advanced cybersecurity solutions tailored for Web3 applications. By integrating decentralized encryption, AI-powered threat detection, and smart contract auditing, Cytonic ensures maximum protection against cyber threats. Whether you’re securing DeFi protocols, NFTs, or enterprise blockchain systems, Cytonic’s cutting-edge security technology provides the highest level of data integrity and protection. https://cytonic.cc
bahis siteleri slot oyunlarД± yeni bonus veren bahis siteleri glГјcksspiel internet casinositeleri1st.shop
UnagiSwap is a cutting-edge decentralized exchange (DEX) that provides fast, secure, and transparent crypto trading. Designed for traders looking to swap digital assets efficiently without intermediaries, UnagiSwap offers low fees, deep liquidity, and seamless smart contract execution. Whether you’re a casual trader or a professional investor, UnagiSwap’s non-custodial platform ensures full control over your assets in a decentralized environment. https://unagiswap.org
sweet bonanza giris: sweet bonanza 1st – sweet bonanza 1st sweetbonanza1st.shop
HyperDrive is transforming the way data is stored and managed through decentralized storage and blockchain hosting solutions. Built for security, scalability, and efficiency, HyperDrive enables businesses, developers, and blockchain projects to store and distribute data without relying on centralized servers. By leveraging Web3 technology and distributed networks, HyperDrive ensures reliable, censorship-resistant, and high-performance storage solutions for the digital era. https://hyperdrive.ink
most bet https://www.mostbet6031.ru .
1вин сайт http://www.1win6042.ru .
iddaa siteleri casibom guncel adres vidobet giriЕџ 2025 casibom1st.shop
casino siteleri: deneme bonusu veren siteler – guvenilir casino siteleri casinositeleri1st.com
Say hello to AquaSculpt—a game-changer in weight loss! These AquaSculpt capsules use natural AquaSculpt ingredients to shed pounds and boost confidence. No AquaSculpt side effects, just pure AquaSculpt results—see why in AquaSculpt reviews. Learn AquaSculpt how to use and join thousands who love it. AquaSculpt buy today at http://aquasculpt.me !
sweet bonanza giris: sweet bonanza siteleri – sweet bonanza 1st sweetbonanza1st.shop
sweet bonanza 1st: sweet bonanza oyna – sweet bonanza giris sweetbonanza1st.shop