-
Notifications
You must be signed in to change notification settings - Fork 563
Closed
Milestone
Description
class Node {
func onTouchPressed (_ f: (TouchEvent) -> ()) -> Disposable
func onTouchMoved (_ f: (TouchEvent) -> ()) -> Disposable
func onTouchReleased(_ f: (TouchEvent) -> ()) -> Disposable
}
class TouchEvent : Event {
let points: TouchPoint
}
class TouchPoint {
let id: Int
let location: Point
}
- Each touch point should have an identifier. iOS using timestamp, so just need to map it to an Int.
- When we pressed on a node, this node should receive all
moveandreleaseevents, even if such events occurs outside of this node. - Note that we can't just route system touch events to a selected node. Here is an example:
a. User pressed on the node1.
b. User pressed on the node2.
c. User moving both fingers. In this case system will send one touch event with two touches. However Macaw engine should send one event to node1 and another to node2. - Make sure that if some node received
onTouchPressedevent, it should receiveonTouchReleasedat some point.