#include "shared/view.h"
#include <dali/dali.h>
#include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/shader-effects/motion-stretch-effect.h>
using namespace Dali;
using namespace Dali::Toolkit;
{
// The Init signal is received once (only) during the Application lifetime
- DemoHelper::RequestThemeChange();
-
Stage::GetCurrent().KeyEventSignal().Connect(this, &MotionStretchExampleApp::OnKeyEvent);
// Creates a default view with a default tool bar.
winHandle.AddAvailableOrientation( Dali::Window::PORTRAIT_INVERSE );
winHandle.AddAvailableOrientation( Dali::Window::LANDSCAPE_INVERSE );
- winHandle.GetOrientation().ChangedSignal().Connect( this, &MotionStretchExampleApp::OnOrientationChanged );
- unsigned int degrees = winHandle.GetOrientation().GetDegrees();
+ // winHandle.GetOrientation().ChangedSignal().Connect( this, &MotionStretchExampleApp::OnOrientationChanged );
+ unsigned int degrees = 0;
Rotate( static_cast< DeviceOrientation >( degrees ) );
mContentLayer.Add( mMotionStretchImageActor );
// Create shader used for doing motion stretch
- mMotionStretchEffect = MotionStretchEffect::Apply(mMotionStretchImageActor);
+ mMotionStretchEffect = Toolkit::CreateMotionStretchEffect();
+ Dali::Property::Index uModelProperty = mMotionStretchEffect.GetPropertyIndex( "uModelLastFrame" );
+ Constraint constraint = Constraint::New<Matrix>( mMotionStretchEffect, uModelProperty, EqualToConstraint() );
+ constraint.AddSource( Source( mMotionStretchImageActor , Actor::Property::WORLD_MATRIX ) );
+ constraint.Apply();
+ mMotionStretchImageActor.SetShaderEffect( mMotionStretchEffect );
}
//////////////////////////////////////////////////////////////
PushButton mActorEffectsButton; ///< The actor effects toggling Button.
// Motion stretch
- MotionStretchEffect mMotionStretchEffect;
+ ShaderEffect mMotionStretchEffect;
ImageActor mMotionStretchImageActor;
// animate actor to position where user taps screen
//
int main(int argc, char **argv)
{
- Application app = Application::New(&argc, &argv);
+ Application app = Application::New(&argc, &argv, DALI_DEMO_THEME_PATH);
RunTest(app);