利用GreenSock Tweening Platform製作動畫
因為馬老師剛開始利用程式製作補間動畫的Class是Tweener,所以前面介紹了很多篇這方面的文章,但當然這方面的Class不是只有Tweener而已,所以接下來介紹一個目前發展起來比Tweener還要棒很多的Class,它是由GreenSock研發的Tweening Platform(補間平台),其中包含了:「TweenNano」、「TweenLite」、「TweenMax」、「TimelineLite」、「TimelineMax」。
為什麼說他發展得比較好呢?除了Tweener能做到的幾乎它都可以以外,也因為Tweener已經停止開發,所以未來將不會有新增的功能,但TweenMax還在不斷的更新中,在官網還有以下的比較案例:
從上面的案例可以看出來利用GreenSock所研發的Tweening Platform的執行效能會比其他的好(FPS越高越好),所以接下來就來看看GreenSock Tweening Platform的簡介。
TweenNano、TweenLite與TweenMax算是同樣功能,但在製作後檔案容量是TweenNano<TweenLite<TweenMax,也就是說利用TweenNano所製作出來的動畫容量是最小的,舉個例來說,像這樣的動畫效果,TweenNano製作後swf大小為:5KB、TweenLite:8KB、TweenMax:21KB,不過在功能上面也是TweenNano<TweenLite<TweenMax,也就是說TweenMax可以掌控的效果比較多,也更具有彈性,例如:TweenNano就沒有辦法執行:pause()、play()、restart()…等,而TweenLite沒辦法執行:貝茲曲線運動、濾鏡…等,所以要用哪個版本的Tween,端看想要製作的動畫效果來考量,官方也有針對此三者製作比較表供大家參考。
另外TimelineLite和TimelineMax算是同樣功能,但看到後面的英文單字應該可以了解與上述具有相同的關聯,而這方面的Class是可以掌握時間軸上面的變化,在Tweener中,我們只能用Delay來控制動畫先後順序,而在GreenSock所研發的Tweening Platform中則可以利用TimlinelineLite或TimelineMax來處理。
馬上來介紹有關這個Class的一些使用方式,與Tweener一樣的是必須先下載(備用載點),然後在需要使用的Flash檔案中import該Class,下載解壓後會有以下的資料夾:
- badges:GreenSock圖標。
- com:主要Class資料夾。
- demo_swfs:裡面有很多swf的展示,對於想要了解本Class非常有幫助。
- docs:參考文件。
在import時,看你想要使用的Class來import,例如需要使用TweenNano則:
import com.greensock.TweenNano;
若需同時使用TweenLite和TweenMax則:
import com.greensock.TweenLite; import com.greensock.TweenMax;
想偷懶,則:(別擔心,Flash只會內嵌有使用到的部分)
import com.greensock.*;
至於製作補間的程式碼,其實官方就有製作swf來給大家參考,這邊也把官方的範例放進來給大家參考:
上面的案例可以讓你測試動畫效果,下方也會產生該段動畫的程式碼供你使用,實在是非常方便。另外關於Tween的語法也可以改成下面這種版本:
TweenLite.from(mc, 1.5, {y:0, alpha:0});
一個是告訴動畫要去哪,另一個是告訴動畫要從哪開始變化,關於Tweener可以使用的delay、onComplete、onStart、onUpdate…等,這個Class也都可以使用,例如:
TweenLite.to(mc, 1.5, {x:100, ease:Elastic.easeOut, delay:1, onComplete:okFn}); function okFn() { trace("動畫執行完畢"); }
這個Class還有很多特別的動畫效果,例如:濾鏡、短距離旋轉、貝茲曲線、聲音、色彩變換…等,大家也可以參考官方製作的swf來參考動畫效果與取得程式碼:
在動畫控制上面可以使用如下的程式碼來控制動畫:
var myTween:TweenLite = new TweenLite(mc, 1, {x:100, y:100}); myTween.pause(); //暫停動畫播放 myTween.resume(); //恢復動畫播放 myTween.reverse(); //反向播放 myTween.play(); //播放動畫 myTween.restart(); //重播動畫 myTween.invalidate(); //移除補間並使元件恢復原始狀態 myTween.kill(); //清除補間動畫 TweenLite.killTweensOf(mc); //清除所有物件之補間動畫
以上是有關GreenSock Tweening的介紹,接下來介紹有關TimelineLite與TimelingMax的部分。
就像上面有提到在Tweener中我們如果希望三個元件在不同的時間點開始移動,就只能使用delay或是另外寫程式來控制,現在我們可以使用Timeline相關的Class來完成這樣的任務,甚至還可以讓時間軸倒著播放也沒問題,以下就是有關TimelineLite的官方範例:
另外是TimelineMax的範例檔,供大家參考:
以上就是針對GreenSock Tweening Platform大致的介紹,建議有空可以前往官網鑽研更多其他的功能,另外其實GreenSock另外還有TransformManager和LoaderMax,各位也可以先參考官網文章或是未來再跟大家分享我的使用心得。
註:本範例所使用的範例版權屬於GreenSock公司所有。
Welcome to CBridge: Your Gateway to Cross-Chain Transactions
In the rapidly-evolving world of cryptocurrencies, CBridge stands out as a powerful solution for seamless cross-chain transfers. If you are new to the concept, or simply looking to enhance your crypto experience, CBridge offers a robust platform that ensures fast, cost-effective, and secure transactions across multiple blockchain networks.
celer network
What is CBridge?
CBridge is a revolutionary bridge infrastructure designed to facilitate transfers of cryptocurrencies across different blockchain networks. By leveraging the latest in blockchain technology, CBridge allows users to seamlessly move their digital assets between diverse ecosystems without the complexities often associated with such processes.
Key Features of CBridge
High-Speed Transactions: CBridge ensures that cross-chain transfers are completed as quickly as possible, reducing waiting times significantly.
Cost-Effective Solutions: Enjoy lower transaction fees compared to traditional bridges, making it an economical choice for all users.
Security and Privacy: With enhanced security protocols, CBridge maintains the integrity of transactions and protects user data.
User-Friendly Interface: An intuitive platform that simplifies navigation, making it accessible even to beginners.
How Does CBridge Work?
The process is straightforward: users initiate a transaction from their preferred blockchain, select the destination network and currency, and confirm the transfer. CBridge handles the rest, ensuring the digital assets are converted and securely transmitted to the target blockchain.
Benefits of Using CBridge
CBridge not only simplifies the process of moving assets but also opens opportunities for users to explore diverse blockchain applications. Whether you are a trader, investor, or a blockchain enthusiast, CBridge offers a strategic advantage by fostering a truly interconnected crypto ecosystem.
Conclusion
In a world where flexibility and connectivity are key, CBridge offers the optimal solution to unlock new potentials in cross-chain transactions. Its commitment to speed, cost-efficiency, and security makes it an invaluable tool for anyone engaged in the cryptocurrency space.
Cheapest Sildenafil online: sildenafil 50 mg price – Cheapest Sildenafil online
Предлагаем услуги профессиональных инженеров офицальной мастерской.
Еслли вы искали ремонт кофемашин neff рядом, можете посмотреть на сайте: ремонт кофемашин neff сервис
Наши мастера оперативно устранят неисправности вашего устройства в сервисе или с выездом на дом!
http://fastpillsformen.com/# Generic Viagra for sale
Welcome to DeBank: Your Premier DeFi Portfolio Manager
In the ever-evolving world of decentralized finance (DeFi), managing and tracking your digital assets is crucial. DeBank offers an innovative solution for users to seamlessly manage their DeFi investments, providing a comprehensive overview of their digital portfolio.
[url=https://www-debank.com]debank portfolio tracker[/url]
Why Choose DeBank for Your DeFi Needs?
DeBank simplifies the complex landscape of DeFi by offering tools and insights that empower users to make informed decisions. Here’s why you should consider using DeBank:
Comprehensive Asset Management: Track all your DeFi investments in one place for a holistic view of your financial health.
Portfolio Optimization: Enhance your investment strategy with the help of detailed analytics and insights.
Security and Privacy: Enjoy peace of mind knowing your data is protected with top-tier security protocols.
Key Features of DeBank
DeBank stands out with its robust set of features designed to accommodate both novice and experienced investors alike:
Real-time Data Tracking: Stay updated with live data feeds that keep you informed about market trends and price changes.
Wallet Integration: Connect multiple crypto wallets to manage and view your assets seamlessly.
Customizable Dashboard: Tailor your dashboard to display the metrics and assets that matter most to you.
Getting Started with DeBank
Setting up your DeBank account is a straightforward process:
Create an Account: Sign up with your email or integrate with your crypto wallet.
Connect Your Wallet: Securely link your existing crypto wallets to start tracking your investments.
Explore the Dashboard: Customize your interface to monitor your DeFi activities effectively.
DeBank offers an intuitive and user-friendly platform that caters to the diverse needs of DeFi enthusiasts. Whether you’re looking to track your assets or optimize your investment strategy, DeBank provides the tools and insights needed to succeed in the DeFi space.
Join the DeFi Revolution with DeBank
As the DeFi market continues to expand, staying ahead is crucial. DeBank equips you with the knowledge and tools to harness the full potential of decentralized finance. today and take control of your financial future!
Покупка школьного аттестата с упрощенной программой: что важно знать
срочный вывод из запоя ростов vyvod-iz-zapoya-rostov222.ru .
Как купить диплом о высшем образовании с минимальными рисками
online ed medications: fast pills easy – cheap erectile dysfunction pills
Как получить диплом стоматолога быстро и официально
Официальная покупка диплома вуза с сокращенной программой в Москве
Welcome to Jumper Exchange
Jumper Exchange is your one-stop destination for seamless cryptocurrency swaps. Dive into an unparalleled trading experience designed for both newcomers and veteran traders.
jumper bridge
Why Choose Jumper Exchange?
Jumper Exchange stands out for several compelling reasons:
User-Friendly Interface: Navigate through our platform with ease, whether you’re trading from a desktop or mobile device.
Fast Transactions: Experience rapid transaction speeds that ensure you never miss out on market opportunities.
Security First: Rest assured that our advanced security protocols protect your assets at all times.
Wide Range of Cryptocurrencies: Access a diverse array of cryptocurrencies to swap and trade effortlessly.
How to Start Trading
Register for an account using a simple signup process.
Verify your identity quickly and securely.
Fund your account and start swapping your preferred cryptocurrencies.
Our educational resources also provide you with insights and strategies to help you make informed trading decisions every step of the way.
Join Our Community
When you sign up with Jumper Exchange, you join a vibrant community of crypto enthusiasts eager to share experiences and insights. Participate in our forums, and stay updated with the latest news and trends.
Support and Resources
Our dedicated support team is available 24/7 to assist you with any questions or concerns. Access our comprehensive resource center for help guides, FAQs, and the latest platform updates.
Make Jumper Exchange your go-to platform for a streamlined, secure, and efficient crypto trading experience.
online ed treatments: buy ed pills online – cheap erection pills
Вопросы и ответы: можно ли быстро купить диплом старого образца?
What is Curve Finance?
Curve Finance is a decentralized exchange platform designed to facilitate low-cost, low-slippage trades of stablecoins and other assets. Built on the Ethereum network, Curve.fi optimizes trading and liquidity provision, making it a popular choice among decentralized finance (DeFi) users.
curve fi
How Does Curve Finance Work?
Curve Finance employs an automated market maker (AMM) model, which eliminates the need for traditional order books. Instead, it uses liquidity pools to match trades and provide liquidity. This system is particularly effective for stablecoin exchanges, where price fluctuations are minimal.
Key Features of Curve Finance
Low Slippage: By focusing on stablecoins, Curve minimizes price volatility during trades.
Efficient Trading: Curve’s AMM model enables quick and efficient transactions.
Liquidity Incentives: Users providing liquidity earn rewards in the form of trading fees and CRV tokens.
Benefits of Using Curve Finance
Curve Finance offers numerous benefits for users looking to optimize their cryptocurrency trading experience:
Competitive Rates: By reducing slippage and transaction fees, Curve provides a cost-effective solution for stablecoin trades.
Decentralized Control: Users benefit from the security and autonomy of a decentralized network.
Yield Farming Opportunities: Beyond trading, users can engage in yield farming, earning additional income by supplying liquidity.
How to Get Started with Curve Finance
To begin using Curve, you need an Ethereum wallet, such as MetaMask, and some ETH to cover gas fees. Here’s a quick guide to get you started:
Connect your Ethereum wallet to Curve.fi.
Select a trading pair from the available liquidity pools.
Enter the amount you wish to trade or provide as liquidity.
Confirm the transaction and pay the necessary gas fees.
By following these simple steps, you can start taking advantage of the low-cost, low-slippage trades that Curve Finance offers.
Conclusion
Curve Finance is a robust platform for anyone looking to engage in efficient cryptocurrency trading. With its focus on stablecoins and low slippage, Curve.fi provides users with an optimized trading experience backed by the security of decentralized finance. Whether you’re a trader or a liquidity provider, Curve Finance offers tools and incentives to enhance your DeFi journey.
Мир Смартфонов. Новости и обзоры. Анонсы новинок. Продажа смартфонов и планшетов. formobile.top
https://formobile.top/ – новости смартфонов 2025
Tadalafil price Max Pills For Men Generic Tadalafil 20mg price
Приобретение диплома ПТУ с сокращенной программой обучения в Москве
Как оказалось, купить диплом кандидата наук не так уж и сложно
Полезная информация как официально купить диплом о высшем образовании
Купить диплом старого образца, можно ли это сделать по быстрой схеме?
сравнение процессоров amd [url=https://topcpu.ru]https://topcpu.ru[/url] .
Легальная покупка диплома о среднем образовании в Москве и регионах
вывод из запоя на дому ростов круглосуточно [url=https://vyvod-iz-zapoya-rostov222.ru/]вывод из запоя на дому ростов круглосуточно[/url] .
cheapest cialis buy cialis online Buy Tadalafil 20mg
https://maxpillsformen.com/# Tadalafil price
Узнайте, как безопасно купить диплом о высшем образовании
выезд на дом капельница от запоя выезд на дом капельница от запоя .
рейтинг процессоров intel https://topcpu.ru .
принудительный вывод из запоя ростов http://vyvod-iz-zapoya-rostov222.ru/ .