- Size stageSize = Stage::GetCurrent().GetSize();
- mMotionBlurActorSize = Size( std::min( stageSize.x * 0.3f, MOTION_BLUR_ACTOR_WIDTH ), std::min( stageSize.y * 0.3f, MOTION_BLUR_ACTOR_HEIGHT ) );
- mMotionBlurActorSize = Size( std::min( mMotionBlurActorSize.x, mMotionBlurActorSize.y ), std::min( mMotionBlurActorSize.x, mMotionBlurActorSize.y ) );
-
- Image image = LoadImageFittedInBox( MOTION_BLUR_ACTOR_IMAGE1, mMotionBlurActorSize.x, mMotionBlurActorSize.y );
- mMotionBlurImageActor = ImageActor::New(image);
- mMotionBlurImageActor.SetParentOrigin( ParentOrigin::CENTER );
- mMotionBlurImageActor.SetSize(mMotionBlurActorSize.x, mMotionBlurActorSize.y);
-
- mContentLayer.Add( mMotionBlurImageActor );
-
- // Create shader used for doing motion blur
- mMotionBlurEffect = MotionBlurEffect::Apply(mMotionBlurImageActor);
-
-
-#ifdef MULTIPLE_MOTION_BLURRED_ACTORS
-
- ///////////////////////////////////////////////////////
- //
- // Motion blurred actor 2
- //
-
- mMotionBlurImageActor2 = ImageActor::New(image);
- mMotionBlurImageActor2.SetParentOrigin( ParentOrigin::CENTER );
- mMotionBlurImageActor2.SetSize(mMotionBlurActorSize.x, mMotionBlurActorSize.y);
- mMotionBlurImageActor2.SetPosition(mMotionBlurActorSize.x * 1.1f, 0.0f);
- mMotionBlurImageActor.Add( mMotionBlurImageActor2 );
-
- // Create shader used for doing motion blur
- mMotionBlurEffect2 = MotionBlurEffect::New(MOTION_BLUR_NUM_SAMPLES);
-
- // set actor shader to the blur one
- mMotionBlurImageActor2.SetShaderEffect( mMotionBlurEffect2 );
-
-
- ///////////////////////////////////////////////////////
- //
- // Motion blurred actor 3
- //
-
- mMotionBlurImageActor3 = ImageActor::New(image);
- mMotionBlurImageActor3.SetParentOrigin( ParentOrigin::CENTER );
- mMotionBlurImageActor3.SetSize(mMotionBlurActorSize.x, mMotionBlurActorSize.y);
- mMotionBlurImageActor3.SetPosition(-mMotionBlurActorSize.x * 1.1f, 0.0f);
- mMotionBlurImageActor.Add( mMotionBlurImageActor3 );
-
- // Create shader used for doing motion blur
- mMotionBlurEffect3 = MotionBlurEffect::New(MOTION_BLUR_NUM_SAMPLES);
-
- // set actor shader to the blur one
- mMotionBlurImageActor3.SetShaderEffect( mMotionBlurEffect3 );
-
-
- ///////////////////////////////////////////////////////
- //
- // Motion blurred actor 4
- //
-
- mMotionBlurImageActor4 = ImageActor::New(image);
- mMotionBlurImageActor4.SetParentOrigin( ParentOrigin::CENTER );
- mMotionBlurImageActor4.SetSize(mMotionBlurActorSize.x, mMotionBlurActorSize.y);
- mMotionBlurImageActor4.SetPosition(0.0f, mMotionBlurActorSize.y * 1.1f);
- mMotionBlurImageActor.Add( mMotionBlurImageActor4 );
-
- // Create shader used for doing motion blur
- mMotionBlurEffect4 = MotionBlurEffect::New(MOTION_BLUR_NUM_SAMPLES);
-
- // set actor shader to the blur one
- mMotionBlurImageActor4.SetShaderEffect( mMotionBlurEffect4 );
-