- Image image = ResourceImage::New( MOTION_BLUR_ACTOR_IMAGE1 );
- mMotionBlurImageActor = ImageActor::New(image);
- mMotionBlurImageActor.SetParentOrigin( ParentOrigin::CENTER );
- mMotionBlurImageActor.SetSize(MOTION_BLUR_ACTOR_WIDTH, MOTION_BLUR_ACTOR_HEIGHT);
-
- 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(MOTION_BLUR_ACTOR_WIDTH, MOTION_BLUR_ACTOR_HEIGHT);
- mMotionBlurImageActor2.SetPosition(MOTION_BLUR_ACTOR_WIDTH * 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(MOTION_BLUR_ACTOR_WIDTH, MOTION_BLUR_ACTOR_HEIGHT);
- mMotionBlurImageActor3.SetPosition(-MOTION_BLUR_ACTOR_WIDTH * 1.1f, 0.0f);
- mMotionBlurImageActor.Add( mMotionBlurImageActor3 );
+ // Scale down actor to fit on very low resolution screens with space to interact:
+ mMotionBlurActorSize = Size(std::min(windowSize.x * 0.3f, MOTION_BLUR_ACTOR_WIDTH), std::min(windowSize.y * 0.3f, MOTION_BLUR_ACTOR_HEIGHT));
+ mMotionBlurActorUpdateSize = Size(std::max(mMotionBlurActorSize.x, mMotionBlurActorSize.y), std::max(mMotionBlurActorSize.x, mMotionBlurActorSize.y));
+ mMotionBlurActorSize = Size(std::min(mMotionBlurActorSize.x, mMotionBlurActorSize.y), std::min(mMotionBlurActorSize.x, mMotionBlurActorSize.y));