This signal will be emitted by DALi whenever the touch occurs within the connected actor's bounds.
Each point on the screen that is currently being touched or where touch has stopped is represented by a point.
-Dali::TouchData stores information about the state of each point (down, up, motion etc.) and the co-ordinates of the touch.
+Dali::TouchEvent stores information about the state of each point (down, up, motion etc.) and the co-ordinates of the touch.
When a multi-touch event occurs, each point represents the points that are currently being touched or the points where touch has stopped.
The following example shows how a connection to a touch event signal can be established:
@code
-bool OnTouch( Dali::Actor actor, const Dali::TouchData& touch )
+bool OnTouch( Dali::Actor actor, const Dali::TouchEvent& touch )
{
bool handled = false;
// Elsewhere
Dali::Actor actor = Actor::New();
-actor.TouchSignal().Connect( &OnTouch );
+actor.TouchedSignal().Connect( &OnTouch );
@endcode
The primary touch point is the first point that the user touches.
If this hit actor does not handle (consume) the event, then the event is offered to the hit actor's parent.
Again, if the parent does not handle this event, it is then offered to its parent and so on until the stage is reached or the event is consumed.
-If the TouchSignal of both a parent and child are connected to, then the touch event is first offered to the child's listener.
+If the TouchedSignal of both a parent and child are connected to, then the touch event is first offered to the child's listener.
If it is consumed by the child's listener, then the parent will not be informed.
<h2 class="pg">Gestures</h2>
void OnPinch( Dali::Actor actor, const Dali::PinchGesture& pinch )
{
// Scale your actor according to the pinch scale
- Vector3 newSize = actor.GetCurrentSize() * pinch.scale;
- actor.SetSize(newSize);
+ Vector3 newSize = actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ) * pinch.scale;
+ actor.SetProperty( Actor::Property::SIZE, newSize );
}
// Elsewhere