mTimerForBubbleEmission.TickSignal().Connect(this, &BubbleEffectExample::OnTimerTick);
// Connect the callback to the touch signal on the background
- mBackground.TouchedSignal().Connect( this, &BubbleEffectExample::OnTouch );
+ mBackground.TouchSignal().Connect( this, &BubbleEffectExample::OnTouch );
}
}
// Callback function of the touch signal on the background
- bool OnTouch(Dali::Actor actor, const Dali::TouchEvent& event)
+ bool OnTouch(Dali::Actor actor, const Dali::TouchData& event)
{
- const TouchPoint &point = event.GetPoint(0);
- switch(point.state)
+ switch( event.GetState( 0 ) )
{
- case TouchPoint::Down:
+ case PointState::DOWN:
{
- mCurrentTouchPosition = point.screen;
- mEmitPosition = point.screen;
+ mCurrentTouchPosition = mEmitPosition = event.GetScreenPosition( 0 );
mTimerForBubbleEmission.Start();
mNonMovementCount = 0;
break;
}
- case TouchPoint::Motion:
+ case PointState::MOTION:
{
- Vector2 displacement = point.screen - mCurrentTouchPosition;
- mCurrentTouchPosition = point.screen;
+ Vector2 displacement = event.GetScreenPosition( 0 ) - mCurrentTouchPosition;
+ mCurrentTouchPosition = event.GetScreenPosition( 0 );
//emit multiple bubbles along the moving direction when the finger moves quickly
float step = std::min(5.f, displacement.Length());
for( float i=0.25f; i<step; i=i+1.f)
}
break;
}
- case TouchPoint::Up:
- case TouchPoint::Leave:
- case TouchPoint::Interrupted:
+ case PointState::UP:
+ case PointState::LEAVE:
+ case PointState::INTERRUPTED:
{
mTimerForBubbleEmission.Stop();
mEmitAnimation.Play();
mAnimateComponentCount = 0;
break;
}
- case TouchPoint::Stationary:
- case TouchPoint::Last:
+ case PointState::STATIONARY:
default:
{
break;
/*****************************************************************************/
-int
-main(int argc, char **argv)
+int DALI_EXPORT_API main(int argc, char **argv)
{
Application app = Application::New(&argc, &argv, DEMO_THEME_PATH);