利用Tweener製作動畫 – 貝茲曲線

在看過前面一篇Tweener基礎篇之後,應該會發現我們的動畫元件雖然可以依照不同的模式移動,但是在路徑上還依然是保持直線移動,而這一篇文章就要來示範如何讓元件利用貝茲曲線來產生移動路徑,至於甚麼是貝茲曲線?大家可以參考維基百科上面的說明,這邊就不贅述了。

在Tweener的官方網站裡有提供一個貝茲曲線產生器的Flash動畫讓大家下載,不過由於官方示範這個貝茲曲線產生器所使用的是舊版本的Tweener Class,所以在程式碼範例上有些缺失,馬老師這邊提供我修改過且進行中文化後的範例供大家下載

Tweener 貝茲曲線產生器 螢幕截圖

範例中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"});

希望這個範例對大家有所幫助,如果還有疑問,也可以在這邊回應唷~

You may also like...

1,426 Responses

  1. tooxslii表示:

    provigil 200mg drug modafinil cost provigil brand

  2. kxgjirdu表示:

    buy modafinil 100mg online brand provigil

  3. DouglasLep表示:

    cialis pharmacy cialis coupon cialis from india

  4. kxmhreyb表示:

    order modafinil without prescription buy provigil online cheap

  5. DouglasLep表示:

    tadalafil 20 mg buy online where to buy liquid cialis tadalafil tablets 20 mg india

  6. awhluzzf表示:

    provigil order order modafinil 100mg online

  7. euwfzmcs表示:

    modafinil tablet buy modafinil 100mg pill modafinil online buy

  8. runsrijs表示:

    modafinil order online provigil tablet cheap provigil

  9. erntptkw表示:

    order provigil 100mg sale provigil over the counter

  10. dailges表示:

    With an estimated size of 50 KB, its compatibility with the system should not be a problem.

    MyWinReg – Registry Editor

    2.74 MB

    Advanced Computer Utilities

    Advanced Search and Replace –
    Searches and replaces text, including sub-strings, in multiple files simultaneously, intelligently determining the way to perform the search for each file. Can replace occur over several backspaces and/or regular expressions.

    Advanced Folder Search –
    Advanced Folder https://wakelet.com/wake/wnOrS86GaTnJl3As5ec_z 8cee70152a dailges

  11. uteela表示:

    Although the software offers several customizable effects and all of the usual animation tools, the quality of the animation remains the same in all cases, regardless of whether it has been created by experienced users or not.

    Description

    LOVELY REALLY: This class is live action and computer generated with your webcam. We are using premiere and After Effects for our work.

    Open the class when I host it.

    This class can be available for one day only (11/13/ https://wakelet.com/wake/OljERVKv0uFOs4h9Hg-sO 8cee70152a uteela

  12. hanfer表示:

    allowed to download, archive will be deleted.
    “BizImg Foggy Autumn” is all about automating the process of which image you will like in a fast and quick way. What took you hours in research and hours in screen viewing, you can just…

    Introducing the next big thing to hit the market: the “Deewaad Remote”! These all-new device allow you to browse, search, and play your entire music library as if you’re sitting right https://medcoi.com/network/upload/files/2022/05/PDQx4ntUqbHXc2e9OY6i_19_2df202c2e1987d0df87a8ed86062d5b8_file.pdf 05e1106874 hanfer

  13. gerigil表示:

    It may be somewhat less popular due to more advanced and dedicated apps, but it has more than enough functions to satisfy the needs of your personal devices.Q:

    The barcode identifier front end manager schema performance limit

    The SharePoint barcode identifier front end manager schema performance limit is set to 50 and there are 16 tabs in this page.
    The page show all tabs when I am accessing to this page like this: http://sanmariano.lineameteo.it/plugins/stationExtremes/redirect.php?url=https://neydwidchuzzbet.weebly.com

    6add127376 gerigil

  14. DouglasLep表示:

    stromectol 12 mg tablets stromectol for sale stromectol

  15. cardan表示:

    The name generator will then create a name and a…

    Get the latest news on demand delivery operations at the Customer Service level! Direct support staff, Account Managers, Technical Support and Operations Professionals all need to know what is going on around them. Innovative customer service tools help you attain a standard of service to keep customers happy without…

    The Personalized Home Pages extension is a one-of-a-kind product allowing you to present the home page of your website with background https://images.google.dz/url?sa=t&url=https://bicompfine.weebly.com

    6add127376 cardan

  16. servan表示:

    Features:
    – A huge varieties of snow textures backgrounds themed for original Winter, Summer, Storm, Snow, Cloud.
    – Ability to turn on or off snow effect.
    – Windows 7 default theme style working
    White Snow Windows 7 theme will be updated soon..

    Automatically download news informations to your weather widget. News/Weather will automatically download & upload news information to weather widget without internet
    or torrent connection (other than you computer). Automatic news repartition on every https://zoppglicolor.weebly.com

    6add127376 servan

  17. orihar表示:

    In the digital art world, people like to show off and have nothing to hide so this screen saver is perfect for true and amateur artists who are looking for a personalized Art Display, or for those who just have a lot of pictures they want to show off to the world.

    Color settings

    There are a lot of different ways to alter the look and feel of this art display.
    The first method is by pressing the custom key combinations which was explained in the main article: https://rcifinselty.weebly.com

    6add127376 orihar

  18. phialli表示:

    Q:

    C# Regex – Determine if string is NULL or Blank

    How can I determine if a string is either NULL or blank? I am wondering if the following will result in the behavior I want.
    string str = String.Empty.IsNullOrWhiteSpace? “Hello” : “World”;

    I would expect it to give me back “Hello”.

    A:

    The IsNullOrWhitespace method is for working out https://jerconscenpa.weebly.com

    6add127376 phialli

  19. aryuric表示:

    Share these photos with you friends and let them know it is Christmas time! To view all the customization features of the theme, please refer to main.dotm > User Customization Guide.
    Additional C

    Rarbgator is an application launcher, designed to make your computer work more smoothly and more productively. With Rarbgator, users can find out the main functions of an application. If users insert some key, it will show the most frequently used command of this application https://aqbilecti.weebly.com

    6add127376 aryuric

  20. zacmei表示:

    A free-of-charge software application designed to enable you to digitally copy videos on to DVD, Blu-ray or 4K media, as well as convert them into other formats.
    Highlights
    The Seagate software package offers the following features:
    • Convert any video to high-definition (HD) formats such as HDMI 2.0/BD, UHD, 2K and 4K;
    • Optimizes the quality of images stored on video DVDs and Blu-ray https://www2.gwdang.com/union/go/?site_id=61&target_url=https://buispirancor.weebly.com

    6add127376 zacmei

  21. thomher表示:

    But no worries, users who know the tool will not become frustrated too easily, and newcomers should be able to figure it out with ease.
    Let’s have a look at its features:
    – Append routing: create the shortest route from two points, like the approach to your destination
    – Custom generated tracks (see GTD-trail) can be easily shared and copied (“Track Name” button)
    – Added the second CO’s cabin on https://lihochkrewil.weebly.com

    6add127376 thomher

發佈留言

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