Egret learning diary entry --- thirty third piece (the contents of the book section 10.2)

 Thirty-third in China (10.2 book content)

  Today, content to be recorded it, is to do animation with Tween.

  Let's look at the effect I successfully tested.

  

  Next, the focus began to classify the book:

    1, using the premise Tween.

    2, Tween parameter description.

    3, after the completion of the implementation of the animation, how to know the animation is finished?

    4, Tween call chain structure.

    5, Tween how to perform many times?

    6, changes Tween displacement.

    7, Tween deferred execution.

    8, Tween changes in real-time function execution.

    9, Tween under the influence of the constraint.

  Key was a little much, but slowly. Get started:

    1, using the premise Tween.

      Ensure that you have introduced Tween library.

      

    2, Tween parameter description.            

      

    3, after the completion of the implementation of the animation, how to know the animation is finished?

      

    4, Tween call chain structure.

      Tween method always returns a Tween object, you can chain calls.

      

      If you want to call () in the callback function to pass parameters, you can set up the call () third argument.

      

    5, Tween how to perform many times?

      Get to fill the inside of the second parameter {loop: true}.

      

      If there is no loop: true, then, Tween animation will only be performed once.

      

      But the loop: true infinite loop. And can not set the loop several times.

      If you need to set up designated play a few times, it needs its own packaging a doAnimation method.

      

      It's operating results.

      

    6, changes Tween displacement.

      In fact, what is change the coordinate position, relatively simple.

      

    7, Tween deferred execution.

      By wait (in milliseconds) to wait for the animation to make the specified milliseconds

      

    8, Tween changes in real-time function execution.

      By get () a second parameter, {onChange: function, onChangeObj: any} acquired animation position.

      

    9, Tween under the influence of the constraint.

      The book describes this phenomenon. . . Too vague.

      

      

      These information. . . Gone. . . . . .

      I have studied for a long time, and finally get to know.

      In order to more clearly show the function, I get three layouts.

      

       Then:

        The outer layer is the "blue background color",

        The second layer is the "pink background color", called "group"

        第三层是 “黄色背景色” ,叫 “mcGroup”。而且还包含了动画对象。

      现在,我把第三层的 includeInLayout 属性 设为 false。

      

      可以看到,第三层跑到了第二层的左上角了。

      接着,我再还原。

      

      可见,第三层又跑到了第二层的中心点了。

      那我再把第二层的 includeInLayout 属性 设为 false。

      

      所以,现在就明白了 includeInLayout 属性的作用了吧。

      就是跳出父类,并且以爷类的左上角为对齐方向。

  至此,10.2节 内容结束。

    

  又是好几个小时过去了。从下午三点弄到现在。太累了。

  我洗澡去了。

Guess you like

Origin www.cnblogs.com/dmc-nero/p/11335252.html