本文整理汇总了C++中Animation::Clear方法的典型用法代码示例。如果您正苦于以下问题:C++ Animation::Clear方法的具体用法?C++ Animation::Clear怎么用?C++ Animation::Clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Animation
的用法示例。
在下文中一共展示了Animation::Clear方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UtcDaliBubbleEmitterRestore
int UtcDaliBubbleEmitterRestore(void)
{
ToolkitTestApplication application;
tet_infoline( " UtcDaliBubbleEmitterRestore " );
Image shapeImage = CreateSolidColorImage( application, Color::GREEN, 5, 5 );
BubbleEmitter emitter = BubbleEmitter::New( Vector2(50.f,50.f),shapeImage, 90, Vector2( 5.f, 10.f ));
Actor root = emitter.GetRootActor();
Stage::GetCurrent().Add( root );
root.SetPosition( Vector3::ZERO );
root.SetParentOrigin( ParentOrigin::CENTER );
root.SetAnchorPoint( AnchorPoint::CENTER );
Actor bubbleMesh = root.GetChildAt( 0 );
Renderer renderer = bubbleMesh.GetRendererAt( 0 );
DALI_TEST_CHECK( renderer );
TestGlAbstraction& gl = application.GetGlAbstraction();
float percentageValue;
Vector4 startEndPosValue;
Animation animation = Animation::New( 0.5f );
emitter.EmitBubble( animation, Vector2(40.f,40.f), Vector2(-5.f,-5.f), Vector2(30.f,30.f) );
Wait(application);
DALI_TEST_CHECK( gl.GetUniformValue<float>( "uPercentage[0]", percentageValue ) );
DALI_TEST_EQUALS( percentageValue, 0.f, TEST_LOCATION );
DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "uStartEndPosition[0]", startEndPosValue ) );
DALI_TEST_EQUALS( startEndPosValue.x, 40.f, TEST_LOCATION );
DALI_TEST_EQUALS( startEndPosValue.y, 40.f, TEST_LOCATION );
animation.Play();
Wait(application, 200);
animation.Clear();
DALI_TEST_CHECK( gl.GetUniformValue<float>( "uPercentage[0]", percentageValue ) );
DALI_TEST_CHECK( percentageValue < 0.5f && percentageValue >= 0.4);
DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "uStartEndPosition[0]", startEndPosValue ) );
DALI_TEST_EQUALS( startEndPosValue.x, 40.f, TEST_LOCATION );
DALI_TEST_EQUALS( startEndPosValue.y, 40.f, TEST_LOCATION );
emitter.Restore();
application.SendNotification();
application.Render();
DALI_TEST_CHECK( gl.GetUniformValue<float>( "uPercentage[0]", percentageValue ) );
DALI_TEST_EQUALS( percentageValue, 0.f, TEST_LOCATION );
DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "uStartEndPosition[0]", startEndPosValue ) );
DALI_TEST_EQUALS( startEndPosValue, Vector4::ZERO, TEST_LOCATION );
END_TEST;
}
示例2: 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();
}