X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=examples%2Fbubble-effect%2Fbubble-effect-example.cpp;h=8de8a42f7a1d09c4deba3214e40ffe8d82a39922;hb=8841ed7ccb5284d5022dc3a59de7ad9a4f657b0e;hp=5cb3625592543c9b79eab003ebbfc3ccc10ddfda;hpb=817d72272b9a49d54bf5f62fba24a733c35ad7a1;p=platform%2Fcore%2Fuifw%2Fdali-demo.git diff --git a/examples/bubble-effect/bubble-effect-example.cpp b/examples/bubble-effect/bubble-effect-example.cpp index 5cb3625..8de8a42 100644 --- a/examples/bubble-effect/bubble-effect-example.cpp +++ b/examples/bubble-effect/bubble-effect-example.cpp @@ -62,7 +62,6 @@ class BubbleEffectExample : public ConnectionTracker public: BubbleEffectExample(Application &app) : mApp(app), - mBackgroundImage(), mBackground(), mBubbleEmitter(), mEmitAnimation(), @@ -128,11 +127,11 @@ private: // Create and initialize the BubbleEmitter object mBubbleEmitter = Toolkit::BubbleEmitter::New( stageSize, - DemoHelper::LoadImage( BUBBLE_SHAPE_IMAGES[mCurrentBubbleShapeImageId] ), + DemoHelper::LoadTexture( BUBBLE_SHAPE_IMAGES[mCurrentBubbleShapeImageId] ), DEFAULT_NUMBER_OF_BUBBLES, DEFAULT_BUBBLE_SIZE); - mBackgroundImage = DemoHelper::LoadStageFillingImage( BACKGROUND_IMAGES[mCurrentBackgroundImageId] ); - mBubbleEmitter.SetBackground( mBackgroundImage, mHSVDelta ); + + mBubbleEmitter.SetBackground( DemoHelper::LoadStageFillingTexture( BACKGROUND_IMAGES[mCurrentBackgroundImageId] ), mHSVDelta ); // Get the root actor of all bubbles, and add it to stage. Actor bubbleRoot = mBubbleEmitter.GetRootActor(); @@ -140,8 +139,10 @@ private: bubbleRoot.SetZ(0.1f); // Make sure the bubbles displayed on top og the background. content.Add( bubbleRoot ); - // Add the background image actor to stage - mBackground.SetBackgroundImage( mBackgroundImage ); + // Set the application background + mBackground.SetProperty( Toolkit::Control::Property::BACKGROUND, Dali::Property::Map() + .Add( Dali::Toolkit::Visual::Property::TYPE, Dali::Toolkit::Visual::IMAGE ) + .Add( Dali::Toolkit::ImageVisual::Property::URL, BACKGROUND_IMAGES[mCurrentBackgroundImageId] )); // Set up the timer to emit bubble regularly when the finger is touched down but not moved mTimerForBubbleEmission = Timer::New( mTimerInterval ); @@ -251,15 +252,19 @@ private: { if(button == mChangeBackgroundButton) { - mBackgroundImage = DemoHelper::LoadStageFillingImage( BACKGROUND_IMAGES[ ++mCurrentBackgroundImageId % NUM_BACKGROUND_IMAGES ] ); + mCurrentBackgroundImageId = (mCurrentBackgroundImageId+1) % NUM_BACKGROUND_IMAGES; - mBubbleEmitter.SetBackground( mBackgroundImage, mHSVDelta ); + //Update bubble emitter background + mBubbleEmitter.SetBackground( DemoHelper::LoadStageFillingTexture( BACKGROUND_IMAGES[ mCurrentBackgroundImageId ] ), mHSVDelta ); - mBackground.SetBackgroundImage( mBackgroundImage ); + // Set the application background + mBackground.SetProperty( Toolkit::Control::Property::BACKGROUND, Dali::Property::Map() + .Add( Dali::Toolkit::Visual::Property::TYPE, Dali::Toolkit::Visual::IMAGE ) + .Add( Dali::Toolkit::ImageVisual::Property::URL, BACKGROUND_IMAGES[mCurrentBackgroundImageId] )); } else if( button == mChangeBubbleShapeButton ) { - mBubbleEmitter.SetShapeImage( DemoHelper::LoadImage( BUBBLE_SHAPE_IMAGES[ ++mCurrentBubbleShapeImageId % NUM_BUBBLE_SHAPE_IMAGES ] ) ); + mBubbleEmitter.SetBubbleShape( DemoHelper::LoadTexture( BUBBLE_SHAPE_IMAGES[ ++mCurrentBubbleShapeImageId % NUM_BUBBLE_SHAPE_IMAGES ] ) ); } return true; } @@ -281,7 +286,6 @@ private: private: Application& mApp; - Image mBackgroundImage; Dali::Toolkit::Control mBackground; Toolkit::BubbleEmitter mBubbleEmitter;