From 4f421720419e1ed529493cd1f00ee02d8774d5ab Mon Sep 17 00:00:00 2001 From: Yoonsang Lee Date: Wed, 22 Jul 2015 15:48:09 +0900 Subject: [PATCH] [DALi][DOC-213] Update Animations Signed-off-by: Yoonsang Lee Change-Id: I5e212cc454c9f58a5f456a8496b7085448c13443 --- org.tizen.ui.guides/html/index.htm | 2 +- .../html/native/dali/animation_n.htm | 50 +++++++++++----------- .../html/native/dali/animation_types_n.htm | 10 +++-- .../html/native/dali/guides_dali_n.htm | 2 +- 4 files changed, 33 insertions(+), 31 deletions(-) diff --git a/org.tizen.ui.guides/html/index.htm b/org.tizen.ui.guides/html/index.htm index f2d43f7..99c8125 100755 --- a/org.tizen.ui.guides/html/index.htm +++ b/org.tizen.ui.guides/html/index.htm @@ -217,7 +217,7 @@
  • Animations
  • diff --git a/org.tizen.ui.guides/html/native/dali/animation_n.htm b/org.tizen.ui.guides/html/native/dali/animation_n.htm index 60910ab..1ccaba2 100755 --- a/org.tizen.ui.guides/html/native/dali/animation_n.htm +++ b/org.tizen.ui.guides/html/native/dali/animation_n.htm @@ -45,14 +45,16 @@

    Animations: Making Your Actors Alive

    -

    Animation is an effect that shows sequential frames in quick succession to give the illusion of movement.

    +

    Animation allows your objects to move around / change their properties for a specified duration.

    -

    DALi provides a rich and easy to use animation framework which allows you to create visually rich applications. The Dali::Animation API can be used to animate the properties of any number of objects, typically Actors. Animation components are shown in a following figure.

    +

    DALi provides a rich and easy to use animation framework which allows you to create visually rich applications. Dali::Animation can be used to animate the animatable properties of any number of objects.

    + +

    Animation components are shown in the following figure:

    Figure: DALi animation components

    DALi animation components

    -

    DALi animations occur in a dedicated thread. This allows animations to run smoothly, regardless of the time taken to process inputs events and other factors in the application code.

    +

    DALi animations occur in a dedicated thread. This allows animations to run smoothly, regardless of the time taken to process inputs events and other factors in the application code. Please see Animations with Multi-Threading

    Creating a Basic Animation

    @@ -94,28 +96,26 @@ animation.Pause();

    Notifications

    -

    Using DALi's signal framework applications can be notified when the animation finishes. The Dali::Animation API supports "fire and forget" behavior, which means that an animation continues to play if the handle is discarded. Note that in the following example, the "Finish" signal is emitted.

    -
    -void ExampleCallback(Animation& source)
    -{
    -   std::cout << "Animation has finished" << std::endl;
    -}
    +

    Using DALi's signal framework applications can be notified when the animation finishes. The Dali::Animation API supports "fire and forget" behavior, which means that an animation continues to play if the handle is discarded. In the following example, the Finished signal is emitted after 2 seconds:

    -void ExampleAnimation(Actor actor) -{ -   Animation animation = Animation::New(2.0f); // Duration 2 seconds -   animation.AnimateTo(Property(actor, Actor::Property::POSITION), 10.0f, 50.0f, 0.0f); -   animation.FinishedSignal().Connect(ExampleCallback); -   animation.Play(); -} // At this point the animation handle has gone out of scope - -Actor actor = Actor::New(); -Stage::GetCurrent().Add(actor); - -// Fire the animation and forget about it -ExampleAnimation(actor); - -// The animation continues, and "Animation has finished" is printed after 2 seconds +
    +  // ... Assuming this code is in the HelloWorldController class
    +  void Create( Application& application )
    +  {
    +    PushButton actor = PushButton::New();
    +    Stage::GetCurrent().Add( actor );
    +
    +    Animation animation = Animation::New(2.0f); // Duration 2 seconds
    +    animation.AnimateTo( Property( actor, Actor::Property::POSITION ), Vector3( 100.0f, 100.0f, 0.0f ) );
    +    animation.FinishedSignal().Connect( this, &HelloWorldController::OnFinished );
    +    animation.Play();  // Fire the animation and forget about it
    +  }  // At this point the animation handle has gone out of scope
    +
    +  void OnFinished( Animation& animation )
    +  {
    +    // Do something when the animation is finished
    +  }
    +  // ...
     

    Alpha Functions

    @@ -134,7 +134,7 @@ float MyAlphaFunction(float progress) AlphaFunction alphaFunction(&MyAlphaFunction); animation.SetDefaultAlphaFunction(alphaFunction);
    -

    It is possible to specify a different alpha function for each animator in an Animation object.

    +

    It is possible to specify a different alpha function for each animate call in an Animation object.

     animation.AnimateTo(Property(actor1, Dali::Actor::Property::POSITION), Vector3(10.0f, 50.0f, 0.0f), Dali::AlphaFunction::EASE_IN);
     
    diff --git a/org.tizen.ui.guides/html/native/dali/animation_types_n.htm b/org.tizen.ui.guides/html/native/dali/animation_types_n.htm index df7b332..26c7f18 100755 --- a/org.tizen.ui.guides/html/native/dali/animation_types_n.htm +++ b/org.tizen.ui.guides/html/native/dali/animation_types_n.htm @@ -11,7 +11,7 @@ - Types of Animations: Various Animations Supported by DALi + Animations Types: Types of Animations Supported by DALi @@ -23,7 +23,7 @@
    -

    Types of Animations: Various Animations Supported by DALi

    +

    Animations Types: Types of Animations Supported by DALi

    -

    Frame Animation

    +

    DALi supports the key frame animation, path animation, and shader effect animation.

    + +

    Key Frame Animation

    DALi provides support for animating between several different values, or key frames. A key frame takes a progress value between 0.0f and 1.0f (0 and 100% respectively) and portrays the value of the property when the animation has progressed that much. You can create several key frames:

    diff --git a/org.tizen.ui.guides/html/native/dali/guides_dali_n.htm b/org.tizen.ui.guides/html/native/dali/guides_dali_n.htm
    index 7973906..1295fda 100755
    --- a/org.tizen.ui.guides/html/native/dali/guides_dali_n.htm
    +++ b/org.tizen.ui.guides/html/native/dali/guides_dali_n.htm
    @@ -61,7 +61,7 @@
     	
  • Animations: Making Your Actors Alive

    Enables you to create animated effects.

  • Resources: Handling Images -- 2.7.4