- backgroundLayer.Add( backgroundImage );
-
- Layer foregroundLayer = Layer::New();
- foregroundLayer.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) );
- foregroundLayer.SetParentOrigin( ParentOrigin::CENTER );
- mBloomView.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 );
-
- AnimateBloomView();
- PulseBloomIntensity();
-
- // Gesture detection
- mTapGestureDetector = TapGestureDetector::New();
- mTapGestureDetector.Attach( mStageRootActor );
- mTapGestureDetector.DetectedSignal().Connect( this, &TestApp::OnTap );
- }
-
- void AnimateBloomView()
- {
- if(mRotationAnimation)
- {
- 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(mBloomView, Degree(720), Vector3::YAXIS, AlphaFunctions::EaseInOut);
- mRotationAnimation.SetEndAction( Animation::Discard );
- mRotationAnimation.SetLooping( true );
- mRotationAnimation.Play();
-
- // BLUR
- mBlurAnimation = Animation::New( 4.0f );
- mBlurAnimation.AnimateTo( Property( mBloomView, mBloomView.GetBlurStrengthPropertyIndex() ), 0.0f, AlphaFunctions::Linear, TimePeriod(0.0f, 0.5f) );
- mBlurAnimation.AnimateTo( Property( mBloomView, mBloomView.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 blooming work
- mBloomView = Dali::Toolkit::BloomView::New();
- mBloomView.SetParentOrigin(ParentOrigin::CENTER);
- mBloomView.SetSize(stageSize * 0.75f);
- mStageRootActor.Add(mBloomView);
- mBloomView.Activate();
-
- // Create the Quit button
- PushButton button;
- button = CreateButton(BUTTON_QUIT, BUTTON_QUIT, BUTTON_SIZE_CONSTRAINT);
- button.SetAnchorPoint(AnchorPoint::BOTTOM_RIGHT);
- button.SetParentOrigin(ParentOrigin::BOTTOM_RIGHT);
- button.SetPosition(-UI_MARGIN, -UI_MARGIN);