当前位置: 首页>>代码示例>>C++>>正文


C++ Animation::AnimateTo方法代码示例

本文整理汇总了C++中Animation::AnimateTo方法的典型用法代码示例。如果您正苦于以下问题:C++ Animation::AnimateTo方法的具体用法?C++ Animation::AnimateTo怎么用?C++ Animation::AnimateTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Animation的用法示例。


在下文中一共展示了Animation::AnimateTo方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: StartTransition

void DissolveEffectApp::StartTransition(Vector2 position, Vector2 displacement)
{
  mAnimation = Animation::New(TRANSITION_DURATION);

  Dali::Toolkit::DissolveEffectSetCentralLine( mCurrentImage, position, displacement, 0.0f );
  mCurrentImage.SetProperty( Toolkit::ImageView::Property::IMAGE, mDissolveEffect );
  mAnimation.AnimateTo( Property( mCurrentImage, "uPercentage" ), 1.0f, AlphaFunction::LINEAR );

  mNextImage.SetOpacity(0.0f);
  mAnimation.AnimateTo( Property( mNextImage, Actor::Property::COLOR_ALPHA ), 1.0f, AlphaFunction::LINEAR );

  if(mUseHighPrecision)
  {
    Dali::Toolkit::DissolveEffectSetCentralLine( mNextImage, position, displacement, 1.0f );
    mNextImage.SetProperty( Toolkit::ImageView::Property::IMAGE, mDissolveEffect );
    mAnimation.AnimateTo( Property( mNextImage, "uPercentage" ), 0.0f, AlphaFunction::LINEAR );
  }
  else
  {
    mAnimation.AnimateTo( Property( mNextImage, Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), AlphaFunction::LINEAR );
  }

  mAnimation.FinishedSignal().Connect( this, &DissolveEffectApp::OnTransitionCompleted );
  mAnimation.Play();
  mIsTransiting = true;
}
开发者ID:tizenorg,项目名称:platform.core.uifw.dali-demo,代码行数:26,代码来源:dissolve-effect-example.cpp

示例2: ContinueAnimation

 /**
  * Resumes animation for another ANIMATION_DURATION seconds.
  */
 void ContinueAnimation()
 {
   Animation animation = Animation::New(ANIMATION_DURATION);
   mAnimationTime += ANIMATION_DURATION;
   animation.AnimateTo( Property(mBouncingMagnifier, mAnimationTimeProperty), mAnimationTime );
   animation.Play();
   animation.FinishedSignal().Connect(this, &ExampleController::OnAnimationFinished);
 }
开发者ID:tizenorg,项目名称:platform.core.uifw.dali-demo,代码行数:11,代码来源:magnifier-example.cpp

示例3: HideMagnifier

 /**
  * Hides the magnifier
  */
 void HideMagnifier()
 {
   if(mMagnifierShown)
   {
     Animation animation = Animation::New(MAGNIFIER_DISPLAY_DURATION);
     animation.AnimateTo(Property(mMagnifier, Actor::Property::SCALE), Vector3::ZERO, AlphaFunction::EASE_OUT);
     animation.Play();
     mMagnifierShown = false;
   }
 }
开发者ID:tizenorg,项目名称:platform.core.uifw.dali-demo,代码行数:13,代码来源:magnifier-example.cpp

示例4: ShowMagnifier

 /**
  * Shows the magnifier
  */
 void ShowMagnifier()
 {
   if(!mMagnifierShown)
   {
     Animation animation = Animation::New(MAGNIFIER_DISPLAY_DURATION);
     animation.AnimateTo(Property(mMagnifier, Actor::Property::SCALE), Vector3::ONE, AlphaFunction::EASE_IN);
     animation.Play();
     mMagnifierShown = true;
   }
 }
开发者ID:tizenorg,项目名称:platform.core.uifw.dali-demo,代码行数:13,代码来源:magnifier-example.cpp

示例5: EmitBubble

void BubbleEmitter::EmitBubble( Animation& animation, const Vector2& emitPosition, const Vector2& direction, const Vector2& displacement )
{
  unsigned int curUniform = mCurrentBubble  % mNumBubblePerActor;
  unsigned int groupIdx = mCurrentBubble / mNumBubblePerActor;
  SetBubbleParameter( mBubbleActors[groupIdx], curUniform, emitPosition, direction, displacement);
  animation.AnimateTo( (mBubbleActors[groupIdx])->GetPercentageProperty(curUniform),
                       1.f, AlphaFunction::LINEAR );

  mCurrentBubble = (mCurrentBubble + 1) % mTotalNumOfBubble;
}
开发者ID:mettalla,项目名称:dali,代码行数:10,代码来源:bubble-emitter-impl.cpp

示例6: UtcDaliPropertyNotificationOrder

int UtcDaliPropertyNotificationOrder(void)
{
  TestApplication application; // Reset all test adapter return codes

  Actor actor = Actor::New();
  Stage::GetCurrent().Add(actor);
  // this should complete in first frame
  PropertyNotification notification1 = actor.AddPropertyNotification( Actor::Property::POSITION_X, GreaterThanCondition(90.0f) );
  notification1.NotifySignal().Connect( &TestCallback );
  // this should complete in second frame
  PropertyNotification notification2 = actor.AddPropertyNotification( Actor::Property::POSITION_X, GreaterThanCondition(150.0f) );
  notification2.NotifySignal().Connect( &TestCallback2 );
  Animation animation = Animation::New( 0.032f ); // finishes in 32 ms
  animation.AnimateTo( Property(actor, Actor::Property::POSITION ), Vector3( 200.0f, 0.0f, 0.0f ), AlphaFunction::LINEAR );
  animation.Play();

  // flush the queue
  application.SendNotification();
  // first frame
  application.Render(RENDER_FRAME_INTERVAL);
  // no notifications yet
  DALI_TEST_EQUALS( gCallBackCalled, false, TEST_LOCATION );
  DALI_TEST_EQUALS( gCallBack2Called, false, TEST_LOCATION );
  gCallBackCalled = false;
  gCallBack2Called = false;

  // dont serve the notifications but run another update & render
  // this simulates situation where there is a notification in event side but it's not been picked up by event thread
  // second frame
  application.Render(RENDER_FRAME_INTERVAL);
  DALI_TEST_EQUALS( gCallBackCalled, false, TEST_LOCATION );
  DALI_TEST_EQUALS( gCallBack2Called, false, TEST_LOCATION );

  // serve the notifications
  application.SendNotification();
  DALI_TEST_EQUALS( gCallBackCalled, true, TEST_LOCATION );
  DALI_TEST_EQUALS( gCallBack2Called, true, TEST_LOCATION );

  gCallBackCalled = false;
  gCallBack2Called = false;
  application.Render(RENDER_FRAME_INTERVAL);
  application.SendNotification();
  DALI_TEST_EQUALS( gCallBackCalled, false, TEST_LOCATION );
  DALI_TEST_EQUALS( gCallBack2Called, false, TEST_LOCATION );

  END_TEST;
}
开发者ID:tizenorg,项目名称:platform.core.uifw.dali-core,代码行数:47,代码来源:utc-Dali-PropertyNotification.cpp

示例7: UtcDaliBaseHandleDoAction

int UtcDaliBaseHandleDoAction(void)
{
  TestApplication application;
  tet_infoline("Positive Test Dali::BaseHandle::UtcDaliBaseHandleDoAction");

  Actor actor = Actor::New();
  BaseHandle actorObject = actor;

  DALI_TEST_CHECK(actorObject);

  // Check that an invalid command is not performed
  Property::Map attributes;
  DALI_TEST_CHECK(actorObject.DoAction("invalidCommand", attributes) == false);

  // Check that the actor is visible
  actor.SetVisible(true);
  DALI_TEST_CHECK(actor.IsVisible() == true);

  // Check the actor performed an action to hide itself
  DALI_TEST_CHECK(actorObject.DoAction("hide", attributes) == true);

  // flush the queue and render once
  application.SendNotification();
  application.Render();

  // Check that the actor is now invisible
  DALI_TEST_CHECK(actor.IsVisible() == false);

  // Check the actor performed an action to show itself
  DALI_TEST_CHECK(actorObject.DoAction("show", attributes) == true);

  // flush the queue and render once
  application.SendNotification();
  application.Render();

  // Check that the actor is now visible
  DALI_TEST_CHECK(actor.IsVisible() == true);

  Stage::GetCurrent().Add(actor);

  // Build an animation with initial duration of 1 second
  float durationSeconds(1.0f);
  Animation animation = Animation::New(durationSeconds);
  BaseHandle animationObject = animation;

  DALI_TEST_CHECK(animationObject);

  // Check the current animation duration is 1 second
  DALI_TEST_EQUALS(animation.GetDuration(), durationSeconds, TEST_LOCATION);

  Vector3 targetPosition(100.0f, 100.0f, 100.0f);
  animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR);

  // Set the new duration to be 2 seconds
  float newDurationSeconds(2.0f);
  Property::Value newDurationSecondsValue = Property::Value( newDurationSeconds );
  attributes["duration"] = newDurationSecondsValue;

  // Check the animation performed an action to play itself with the specified duration of 2 seconds
  animationObject.DoAction("play", attributes);

  bool signalReceived(false);
  AnimationFinishCheck finishCheck(signalReceived);
  animation.FinishedSignal().Connect(&application, finishCheck);

  application.SendNotification();
  application.Render(static_cast<unsigned int>(newDurationSeconds * 1000.0f) + 1u/*just beyond the animation duration*/);

  // We expect the animation to finish
  application.SendNotification();
  finishCheck.CheckSignalReceived();
  DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION );

  // Check the new animation duration is 2 seconds
  DALI_TEST_EQUALS(animation.GetDuration(), newDurationSeconds, TEST_LOCATION);
  END_TEST;
}
开发者ID:mettalla,项目名称:dali,代码行数:77,代码来源:utc-Dali-BaseHandle.cpp


注:本文中的Animation::AnimateTo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。