本文整理汇总了C++中Animation::FinishedSignal方法的典型用法代码示例。如果您正苦于以下问题:C++ Animation::FinishedSignal方法的具体用法?C++ Animation::FinishedSignal怎么用?C++ Animation::FinishedSignal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Animation
的用法示例。
在下文中一共展示了Animation::FinishedSignal方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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);
}
示例3: OnAnimationFinished
/**
* Invoked whenever the animation finishes (every 60 seconds)
* @param[in] animation The animation
*/
void OnAnimationFinished( Animation& animation )
{
animation.FinishedSignal().Disconnect(this, &ExampleController::OnAnimationFinished);
animation.Clear();
ContinueAnimation();
}
示例4: 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;
}
示例5: UtcDaliModelBuildAnimation01
int UtcDaliModelBuildAnimation01(void)
{
TestApplication application;
TestPlatformAbstraction& platform = application.GetPlatform();
tet_infoline("Testing Dali::MeshActor::New()");
Dali::ModelData modelData = BuildTreeModel();
// Raise a request
Model model = Model::New("Tree");
application.SendNotification();
application.Render();
Integration::ResourceRequest* request = platform.GetRequest(); // Return modelData
if(request)
{
platform.SetResourceLoaded(request->GetId(), request->GetType()->id, Integration::ResourcePointer(&(modelData.GetBaseObject())));
}
application.Render();
application.SendNotification();
Actor actor = ModelActorFactory::BuildActorTree(model, ""); // model should be loaded
Stage::GetCurrent().Add(actor);
DALI_TEST_CHECK(model.GetLoadingState() == ResourceLoadingSucceeded);
DALI_TEST_CHECK(actor);
DALI_TEST_CHECK(actor.GetName().compare("root") == 0);
DALI_TEST_EQUALS(model.NumberOfAnimations(), static_cast<size_t>(1), TEST_LOCATION);
unsigned int animIndex=0;
bool found = model.FindAnimation("Anim1", animIndex);
DALI_TEST_CHECK(found);
Animation twigAnim = ModelActorFactory::BuildAnimation(model, actor, animIndex);
DALI_TEST_CHECK(twigAnim);
DALI_TEST_EQUALS(twigAnim.GetDuration(), 10.0f, 0.001, TEST_LOCATION);
DALI_TEST_CHECK(twigAnim.GetDefaultAlphaFunction() == Dali::AlphaFunctions::Linear);
Actor twigActor = actor.FindChildByName("twig");
DALI_TEST_CHECK(twigActor);
// Start the animation
twigAnim.Play();
float durationSeconds = 10.0f;
bool signalReceived(false);
AnimationFinishCheck finishCheck(signalReceived);
twigAnim.FinishedSignal().Connect(&application, finishCheck);
application.SendNotification();
application.Render();
finishCheck.CheckSignalNotReceived();
DALI_TEST_EQUALS( twigActor.GetCurrentPosition(), Vector3(2.0f, 1.0f, 0.0f), 0.01f, TEST_LOCATION );
application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 25% progress */);
application.SendNotification();
DALI_TEST_EQUALS( twigActor.GetCurrentPosition(), Vector3(2.5f, 1.0f, 2.5f), 0.01f, TEST_LOCATION );
application.Render(static_cast<unsigned int>(durationSeconds*500.0f)/* 75% progress */);
application.SendNotification();
DALI_TEST_EQUALS( twigActor.GetCurrentPosition(), Vector3(3.5f, 1.0f, 7.5f), 0.01f, TEST_LOCATION );
application.Render(static_cast<unsigned int>(durationSeconds*500.0f)/* Past Finished */);
application.SendNotification();
DALI_TEST_EQUALS( twigActor.GetCurrentPosition(), Vector3(4.0f, 1.0f, 10.0f), 0.01f, TEST_LOCATION );
finishCheck.CheckSignalReceived();
END_TEST;
}