利用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的官方範例:

TimelineLite 範例檔

另外是TimelineMax的範例檔,供大家參考:

TimelineMax 範例檔

以上就是針對GreenSock Tweening Platform大致的介紹,建議有空可以前往官網鑽研更多其他的功能,另外其實GreenSock另外還有TransformManagerLoaderMax,各位也可以先參考官網文章或是未來再跟大家分享我的使用心得。

註:本範例所使用的範例版權屬於GreenSock公司所有。

You may also like...

30,765 Responses

  1. Sazrvlm表示:

    Купить диплом института по доступной цене возможно, обращаясь к проверенной специализированной компании. Мы оказываем услуги по изготовлению и продаже документов об окончании любых университетов РФ. Приобрести диплом о высшем образовании– bluturr.com/read-blog/803_gde-kupit-diplom-srednem.html

  2. Xazrwgz表示:

    Приобрести диплом ВУЗа!
    Мы готовы предложить дипломы любой профессии по невысоким тарифам. Вы заказываете документ в надежной и проверенной временем компании. : sofa-lab.com/poluchite-diplom-svoej-mechty-uzhe-segodnja-47

  3. 🔰เว็บตsง🚀ไม่ผ่ๅuเอเย่นต์(ไม่ทำเทิs์u)🔰เริ่มต้uเปิดยูสที่1 บๅn🔰รับสูตsแฮ๊คฟรี AI 2021🎰

  4. Rogerbup表示:

    https://clomhealth.shop/# how to get generic clomid pill

  5. WikiFX表示:

    Really appreciate you sharing this blog post. Cool.

  6. осаго росгосстрах цена рассчитать для автомобиля http://www.niievmash.ru .

  7. аппарат ультразвуковой диагностики цена http://www.kupit-uzi-apparat11.ru .

  8. 1win_pkEa表示:

    1вин бонусы 1win5066.ru .

  9. OscarOmist表示:

    Amo Health Care: purchase amoxicillin online – buy cheap amoxicillin online

  10. Sazrfew表示:

    Купить диплом о высшем образовании!
    Приобрести диплом об образовании. Приобретение подходящего диплома через качественную и надежную компанию дарит множество плюсов для покупателя. Это решение помогает сэкономить как длительное время, так и существенные денежные средства. tr.clanfm.ru/posting.phpmode=post&f=33&sid=32ca7642812145a9915f8ccb150f960a

  11. Kingciq表示:

    Видио чат без регистрации. Анонимный чат онлайн. Задать вопрос психологу анонимно.

    Сколько встреч нужно?
    Записаться на консультацию.
    Онлайн сессия от 36474 руб.
    Психолог, Сайт психологов.

  12. Mastersqm表示:

    Сеансы с психологом. Анонимный видеочат. С кем можно поговорить.

    Психологическое консультирование заключается в том, чтобы помочь клиенту разобраться в своих проблемах и вместе с ним найти пути выхода из сложной ситуации.
    Личные или онлайн-встречи с высококвалифицированными специалистами.
    Нужен хороший психолог?

  13. 1win_clEa表示:

    how to activate bonus code in 1win online http://www.1win5066.ru .

  14. Wifeyma表示:

    Психологическая и информационная онлайн-помощь. Психолог оказывает помощь онлайн в чате. Психолог онлайн чат.

    73700 проверенных отзывов.
    Частые разногласия с самыми близкими.
    Услуги психолога · — Консультация психолога.

  15. Risingedv表示:

    Онлайн разговор с психологом. Личный психолог. Психологическая помощь онлайн.

    Запись на прием, оплата, подробная информация о специалистах и отзывы клиентов.
    90944 проверенных отзывов.
    Эмоциональное состояние: тревога, депрессия, стресс, эмоциональное выгорание.

  16. 1win_ycpr表示:

    mobila lemn la comanda mobila lemn la comanda .

  17. Diplomi_qvEa表示:

    Приобрести диплом университета!
    Мы готовы предложить документы ВУЗов, которые расположены на территории всей Российской Федерации.
    diplomidlarf.ru/kupite-legalnij-diplom-s-vneseniem-v-reestr-legko-i-bistro/

  18. расчет страховки на автомобиль калькулятор расчет страховки на автомобиль калькулятор .

  19. 1win_md_gxKi表示:

    1win скачать ios 1win5072.ru .

  20. Diplomi_jbMn表示:

    купить диплом москва купить диплом москва .

  21. сколько стоит аппарат узи сколько стоит аппарат узи .

  22. Rogerbup表示:

    https://clomhealth.shop/# cost of clomid

  23. Mazrpom表示:

    Где купить диплом специалиста?
    Готовый диплом с приложением отвечает стандартам Министерства образования и науки, никто не сумеет отличить его от оригинала – даже со специально предназначенным оборудованием. Получить диплом о высшем образовании – не проблема! odessamama.net/forum.phpmod=viewthread&tid=361873&extra=

  24. Mazrkjx表示:

    Мы предлагаем документы об окончании любых университетов Российской Федерации. Документы производят на настоящих бланках. l4dzone.com/posting.phpmode=post&f=5

  25. 1win_bspr表示:

    cote de pariuri online https://1win5070.ru .

  26. Iariorpss表示:

    Заказать диплом университета по невысокой стоимости можно, обратившись к надежной специализированной компании. Заказать документ ВУЗа вы можете у нас в столице. diplomg-cheboksary.ru/kupite-diplom-s-reestrom-po-nizkoj-tsene-pryamo-sejchas

  27. DennisSar表示:

    Unijoin only supports Bitcoin transactions and requires customers to deposit a minimum of 0.001 BTC. Transaction fees range from 0.5 to 3% depending on the amount that is being transferred. This Bitcoin mixer supports multiple addresses and custom options (max of 10). Nonetheless, confirmation is required. Unijoin does not have a referral program in place. Yomix : Excellent customer support Bitcoin Laundry : Uses stealth pools to anonymize transactions Coinmize : Zero-log policy Bitcoin Mixer : It offers flexible transaction fees and a low minimum transaction limit Coin Mixer : Fast payouts 1. Yomix – Excellent customer support Yomix is a btc shuffle service needed to hide your transfers in the bitcoin world. Yomix currently has a minimum withdrawal threshold of 0.03500000 BTC, so users are advised to deposit more than the entry threshold plus commission, otherwise they will not be able to withdraw funds. The client is asked to set 5 exit addresses. If for some reason, even after a delay of two hours, the user’s balance is not updated, the mixer can contact the support service to take action. For customers who have been inactive for several days, it can take up to 15 minutes after logging in before you see outstanding deposits. Transaction histories are automatically deleted within 1 week after that. The program runs on a dedicated server that is openly connected via the Internet (you don’t need to do this when using the Tor browser). The Bitcoin mixer is launched on another machine, all suspicious activity is monitored, and the website is automatically protected in case of any indication that it is under DDoS attack.What marks Yomix out from the crowd is the fact that this crypto mixer is able to process transactions for Bitcoin and Litecoin. There is a minimum deposit requirement for both Bitcoin and Litecoin. The site is able to support a maximum of 5 multiple addresses with confirmation required for all addresses. No site registration is required and there is a referral program in place. Additionally, Yomix can provide clients with a letter of guarantee.Yomix is a Bitcoin mixer that processes Bitcoin and Bitcoin Cash transactions. The site offers a referral program for new users and supports multiple recipient addresses. Transaction fees start at 0.5% plus an extra 0.0001 BTC for each extra address added.It is one of the best tumblers with a good number of features. It supports Bitcoin cryptocurrency bearing no logs policy. It requires a minimum deposit of 0.0015 BTC and the transaction fee is 0.0% service fee along with an additional 0.0002 BTC per payout address. It supports multiple addresses of up to 5 and requires confirmation. No registration is required and Yomix does not offer a referral program. Pros: It offers flexible transaction fees and a low minimum transaction limitIt offers flexible transaction fees and a low minimum transaction limit 2. Bitcoin Laundry – Uses stealth pools to anonymize transactions Let’s take a look at another one of the leading bitcoin mixers which is incredibly easy to operate. Bitcoin Laundry has a straightforward interface and it is worth mentioning that the service fee is the lowest possible, it is 0.0% with 0.0002 BTC per extra address. Retention period is 7 days when it is easy for a user to manually remove all the logs which are saved for this period because of any future transaction-related problems. There is a time-delay feature, however, it is not possible to be controlled by a user but the mixing platform only.What marks Bitcoin Laundry out from the crowd is the fact that this crypto mixer is able to process transactions for Bitcoin and Litecoin. There is a minimum deposit requirement for both Bitcoin and Litecoin. The site is able to support a maximum of 5 multiple addresses with confirmation required for all addresses. No site registration is required and there is a referral program in place. Additionally, Bitcoin Laundry can provide clients with a letter of guarantee.Grams itself is a brand on the Darknet so I believe not much needs to be said about it. Grams Helix is one of its subsidiaries and is one of the most reputed and widely used Bitcoin Laundry services out there, it’s simple, modern, and definitely trustworthy. Grams supports only Bitcoins for now. It needs 2 confirmations before it cleans and sends you your coins. It obviously supports time-delay, but it’s automatically set to “2 hours” for some reasons. It also supports “Random transactions” for the deposit, the deposit address changes after each transaction and allows you to send more than 1 transactions to Grams Helix instead of sending in all your coins in a single go. The same is also supported for the “output addresses” (where you receive coins) and you can input as many as 5 different BTC addresses where your coins are sent after cleaning them. The coin-deposit address is valid for 8 hours, and any transaction not done within these 8 hours won’t be received by the platform.How it works: unlike other mixers, this site cleans coins with bitcoins purchased by them on cryptocurrency exchanges. Bitcoin Laundry io examines purchased coins using a scoring system with innovative algorithms and the use of technologies such as blockchain volume analysis, cluster analysis, pollution analysis, etc. After that, you will receive your BTC back, divided into random parts, and even sent in different addresses, if necessary. The whole process takes about 6 hours. The mixer does not require registration and does not store any logs. After each mixing operation, a letter of guarantee is sent, and information about it is eliminated after 24 hours, ensuring complete anonymity. The service also provides round-the-clock technical support. MixTum io charges a flat fee of 5% of the transaction, as well as a network fee of 0.00015 BTC. The program has two versions – for regular browsers and Tor. Pros: Extensive FAQ section Customizable mixing settings for better anonymity 3. Coinmize – Zero-log policy Coinmize is a simple service that will increase your privacy while using Ethereum and making Ether transactions. Every single person have its right for a personal privacy even when transacting, trading or donating Ether. Due to ethereum blockchain features you are not completely anonymous while using ETH and here comes Ethereum Mixing Service to help you cut all ties between your old and fresh mixed ETH coins. Using Coinmize mixer makes almost impossible to trace your new Ethereum Address..Based on the experience of many users on the Internet, Coinmize is one of the leading Bitcoin tumblers that has ever appeared. This scrambler supports not only Bitcoins, but also other above-mentioned cryptocurrencies. Exactly this platform allows a user to exchange the coins, in other words to send one type of coins and get them back in another type of coins. This process even increases user’s anonymity. Time-delay feature helps to make a transaction untraceable, as it can be set up to 24 hours. There is a transaction fee of 0.0005 for each extra address.Coinmize provides all the anonymity and protection that comes standard with a Bitcoin mixer, as well as many optional features and benefits that you won’t find anywhere else. If you use a new address for withdrawal, the coins you receive back are completely separated from your previous history on the blockchain, so it is almost impossible to link the transaction history with your personality. SmartMix commission is only 0.5% of the deposit amount plus 0.0001 BTC / 0.00005 BCH for each exit address. 5 output addresses can be set. The privacy policy makes it possible to delete all mixing information as soon as it is completed. The resource provides fast and reliable mixing of bitcoins through a simple and attractive user interface. Coinmize has made two additional functions for its clients in contrast to its colleagues: 1. Affiliate program. Share your anonymous referral link and earn cryptocurrency bonuses. For each mixing operation performed on your link, you receive 50% of the service fee. 2. Loyalty reward program. Use your anonymous SmartClub code with every mixing operation to receive service charge discounts. The more you mix, the more you save.Coinmize is one of its kind and requires special mention. It supports Bitcoin cryptocurrency and is clearly unknown on the point of no logs policy. It requires a deposit of at least 0.01 BTC and the transaction fee is 2% along with the 0.0004 BTC network fee. It supports multiple addresses of up to 10 and requires confirmation of 1. No registration is required and it does not offer a referral program. However, the letter of guarantee is provided. Pros: User-controlled time delaysNo-logs polici 4. Bitcoin Mixer – It offers flexible transaction fees and a low minimum transaction limitBitcoin Mixer has a deposit requirement of 0.001 BTC and supports a maximum of 2 different addresses. Registration is not compulsory but there is a service charge of 4 – 5% on the amount being transferred. For those with a need for additional privacy, Bitcoin Mixer also accepts Bitcoins with a no log policy.As well as others, Bitcoin Mixer has both a clear-web CryptoMixer. This mixing service is notable for accommodating extremely large-volume transactions. After public verification of their reserve of 2000 BTC there is no doubt that users can trust this mixing service and their cryprocurrencies will not be taken. The number of needed confirmations differs depending on the deposited amount, e.g. for depositing less that 25 BTC there is only 1 confirmation needed, in case of sending more than 1000 BTC a user needs to gather 5 confirmations. To use this platform, a Bitcoin Mixer code needs to be created. A user should note it, so it is easy to use it next time. After entering a CryptoMixer code, users need to provide the output address or several of them and then set a time-delay feature. A delay time is determined automatically and a user can modify it if needed. A service fee can be also selected from the table depending on the sent sum. Each transaction requires additional fee of 0.0005 BTC. Also, a calculator on the main page helps every user to see the amount of crypto money sent and got back after mixing.One absolutely unique crypto mixing service is Bitcoin Mixer because it is based on the totally different principle comparing to other services. A user does not just deposit coins to mix, but creates a wallet and funds it with chips from 0.01 BTC to 8.192 BTC which a user can break down according to their wishes. After chips are included in the wallet, a wallet holder can deposit coins to process. As the chips are sent to the mixing service beforehand, next transactions are nowhere to be found and there is no opportunity to connect them with the wallet owner. There is no usual fee for transactions on this mixing service: it uses “Pay what you like” feature. It means that the fee is randomized making transactions even more incognito and the service itself more affordable. Retention period is 7 days and every user has a chance to manually clear all logs prior to this period.This is by far the most unique Bitcoin Mixer I’ve ever encountered till date; that’s so pertaining to its “Time-travel” feature! (Whoa!) Basically instead of operating on the traditional receive unclean coins > send clean coins process, it instead uses a create wallet > fund it with chips beforehand > receive unclean coins > grant access to the pre-funded wallet process! This lets users spend the clean coins even before the unclean coins were sent to the mixer (because the wallet was pre-funded) and that’s the reason I termed it the time-travel mixer. Also it funds the wallets with “chips” which are not the same thing as Bitcoins, they’re basically the private keys which can be exported to your Bitcoin wallets to fund your wallets with the amount the chips were worth. It also lets users bet their Chips which has a chance of doubling the worth of their chips, other advanced features include merging which lets users combine two big chips into one single chip, or splitting which divides one big chip into two smaller chips. Its fee structure too is an unique- “Pay what you like” feature, which not only adds to user anonymity by randomizing the fee but also makes the service more affordable and customizable. Because users completely control when or how much funds they wish to withdraw, it translates into 100% user control on time-delays and distribution control. No logs are kept after a 7-day retention period; or there also is an option to manually scrub all logs whenever you wish prior to this 7-day period. The minimum deposit limit on the platform is 0.0001BTC. Pros: Provides user-controlled time delays It has a positive reputation among the Bitcoin community 5. Coin Mixer – Fast payouts Coin Mixer is being listed at the #1 spot here, well that’s not without substance. The top reasons why I’m in love with this Bitcoin tumbler is because it’s fast, takes care of our anonymity and privacy, and has a very negligible fee. Smartmix bitcoin mixing service The payout is almost instant, all it needs is 2 confirmations for the dirty coins being sent in to be cleaned or tumbled. No account needs to be created to clean your coins either. They have advanced options which let you set “delayed payouts” which further increase your anonymity and make it hard to link the coins going inside to the coins coming out. There’s even an option to add up to 5 addresses, so your coins are broken down into 5 different parts and sent to the different addresses again adding another layer of anonymity. The minimum amount too is pretty low being just 0.001BTC while the maximum limit is 15.32BTC. It’s pocket-friendly as well, with the fee being just 0.5% per mix + 0.0001BTC/address, in fact, it probably is one of the lowest fee in the industry altogether. As for anonymity, they delete all logs related to your mix after 7 days which finally erases the last thread which could ever be linked back to you. So yes, enough reasons to list it at the #1 spot, don’t you agree?If you’re looking for a mixer which neither keeps any logs, nor asks you to register; Coin Mixer is an option you can peek at. It does offer registrations in case you’d want to keep things professional, organized and are a frequent mixer. It’s one of the very few mixers which offer “multiple deposit addresses” (upto 5); so you can break the deposit into multiple parts which add upto your total amount. Even offers 2-FA (via PGP) for account security. It also acts as a BTC aXMR a BTC convertor which further adds anonymity. The fee is randomized between a minimum 1% and a maximum 4%. Minimum Withdrawal and deposit limits are acceptable, currently 0.00045 BTC and 0.0018 BTC respectively. Upto 10 additional addresses supported for each output. Time-delays aren’t completely user-controlled, yet users get to specify the maximum delay they want for the total output. All outputs are processed before this timer is reached. Instant withdrawal too available.This platform can work not only as a toggle switch, but also as a swap, that is, you can clear your coins and change the cryptocurrency to another when withdrawing, which further increases anonymity. As a Bitcoin mixer, this platform provides the ability to set a custom commission: the higher the commission, the better the privacy. There is also a time delay option that increases the level of anonymity by delaying the transaction by 24 hours. The service has an impressive supply of coins, so your transactions are made instantly, as soon as confirmation of the receipt of coins arrives, unless you manually set time delays. The minimum deposit is 0.01 BTC per transaction. Any smaller amount is also accepted, but is considered a “donation” and is not returned to Coin Mixer customers. Finally, they also have a no log policy.In the past, Coin Mixer was one of the most popular Bitcoin mixers available in the cryptocurrency world. The first of its kind, this bitcoin mixer was shut down temporarily before returning to limited service. Nowadays, Coin Mixer is primarily used to facilitate anonymous individual transactions. Pros: It has a positive reputation among the Bitcoin communityAvailable in Tor

發佈回覆給「Mazrkjx」的留言 取消回覆

發佈留言必須填寫的電子郵件地址不會公開。