- mRotationAnimation.Stop();
- }
- if(mResizeAnimation)
- {
- mResizeAnimation.Stop();
- }
- if(mTranslationAnimation)
- {
- mTranslationAnimation.Stop();
- }
- if(mBlurAnimation)
- {
- mBlurAnimation.Stop();
- }
-
- // ROTATE
- float animDuration = 10.0f;
- mRotationAnimation = Animation::New(animDuration);
- mRotationAnimation.RotateBy(mGaussianBlurView, Degree(720), Vector3::YAXIS, AlphaFunctions::EaseInOut);
- mRotationAnimation.SetEndAction( Animation::Discard );
- mRotationAnimation.SetLooping( true );
- mRotationAnimation.Play();
-
- // BLUR
- mBlurAnimation = Animation::New( 4.0f );
- mBlurAnimation.AnimateTo( Property( mGaussianBlurView, mGaussianBlurView.GetBlurStrengthPropertyIndex() ), 0.0f, AlphaFunctions::Linear, TimePeriod(0.0f, 0.5f) );
- mBlurAnimation.AnimateTo( Property( mGaussianBlurView, mGaussianBlurView.GetBlurStrengthPropertyIndex() ), 1.0f, AlphaFunctions::Linear, TimePeriod(2.0f, 0.5f) );
- mBlurAnimation.SetEndAction( Animation::Discard );
- mBlurAnimation.SetLooping( true );
- mBlurAnimation.Play();
- }
-#else //#ifdef ADD_REMOVE_FROM_STAGE_TEST
-
- void Create2(Image loadedImage)
- {
- Stage stage = Stage::GetCurrent();
- Vector2 stageSize = stage.GetSize();
-
- mStageRootActor = Actor::New();
- mStageRootActor.SetParentOrigin(ParentOrigin::CENTER);
- mStageRootActor.SetSize(stageSize);
- stage.Add(mStageRootActor);
-
- // Create the object that will perform the blurring work
- mGaussianBlurView = Dali::Toolkit::GaussianBlurView::New();
- mGaussianBlurView.SetParentOrigin(ParentOrigin::CENTER);
- mGaussianBlurView.SetSize(stageSize * 0.75f);
- mStageRootActor.Add(mGaussianBlurView);
- mGaussianBlurView.Activate();
-
- // Create the Quit button
- PushButton button;
- button = CreateButton(BUTTON_QUIT, BUTTON_QUIT_LABEL, BUTTON_SIZE_CONSTRAINT);
- button.SetAnchorPoint(AnchorPoint::BOTTOM_RIGHT);
- button.SetParentOrigin(ParentOrigin::BOTTOM_RIGHT);
- button.SetPosition(-UI_MARGIN, -UI_MARGIN);
-
- // Create the background image
- Image background = Image::New(BACKGROUND_IMAGE_PATH);
- ImageActor backgroundImage = ImageActor::New(background);
- backgroundImage.SetParentOrigin(ParentOrigin::CENTER);
- backgroundImage.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) );
-
- Layer backgroundLayer = Layer::New();
- backgroundLayer.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) );
- backgroundLayer.SetParentOrigin( ParentOrigin::CENTER );
- mGaussianBlurView.Add( backgroundLayer );
- backgroundLayer.Add( backgroundImage );
-
- Layer foregroundLayer = Layer::New();
- foregroundLayer.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) );
- foregroundLayer.SetParentOrigin( ParentOrigin::CENTER );
- mGaussianBlurView.Add( foregroundLayer );
-
- // Create visible actors
- mObjectRootActor = Actor::New();
- mObjectRootActor.SetParentOrigin( ParentOrigin::CENTER );
- mObjectRootActor.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) );
- foregroundLayer.Add( mObjectRootActor );
-
- ImageActor imageActor = ImageActor::New( mDiffuseImage );
- imageActor.SetParentOrigin( ParentOrigin::CENTER );
- imageActor.SetSize( stageSize * 0.75f);
- mObjectRootActor.Add( imageActor );
-
- imageActor = ImageActor::New( mDiffuseImage );
- imageActor.SetParentOrigin( ParentOrigin::CENTER );
- imageActor.SetSize( stageSize * 0.5f );
- imageActor.SetPosition(0.0f, 0.0f, 100.0f);
- mObjectRootActor.Add( imageActor );
-
- ToggleAnimation();
-
- // Gesture detection
- mTapGestureDetector = TapGestureDetector::New();
- mTapGestureDetector.Attach( mStageRootActor );
- mTapGestureDetector.DetectedSignal().Connect( this, &TestApp::OnTap );
- }
-
- PushButton CreateButton(const std::string& name, const std::string& label, const Vector3& sizeConstraint)
- {
- // Create the button
- Image img = Image::New(BUTTON_BACKGROUND_IMAGE_PATH);
- ImageActor background = ImageActor::New(img);