How do I use multi-touch to move more than one object?
In this lesson we will show you how to use the 'touch' messages in LiveCode to move two objects around the screen.
You will require a touch screen device that support multi-touch, i.e. the iPhone and most modern android devices.
You can download the sample stack from this url: https://tinyurl.com/y73qlhgt
Setup our stack

1) Create a new stack, name it and save it
2) Stop the stack from being resized
3) Set the width and height of the stack to 320 x 480
Add the 2 graphics

1) Create a square graphic
2) Set its name to 'square' / 'square2'
3) Make the graphic 'opaque'
4) Go to the colors & patterns inspector and set the 'backgroundColor' to one you like
repeat so that you have 2
Basic Multi-touch Messages
We're going to leave the interface for a moment and look at the basic messages we receive from Rev when touches start, end and move.
on touchStart pTouchId
# Sent each time a new touch is started
end touchStart
on touchEnd pTouchId
# Sent each time a touch ends
end touchEnd
on touchMove pTouchId, pX, pY
# Sent when any touch moves
end touchMove
If a user places two fingers on the device, two touch starts messages will be sent to you stack. You will also be sent a touch ID so you can tell they are different.
Add code to move the object touched
on touchStart pTouchId
# Sent each time a new touch is started
end touchStart
on touchEnd pTouchId
# Sent each time a touch ends
end touchEnd
on touchMove pTouchId, pX, pY
# Sent when any touch moves
set the loc of the target to pX,pY
end touchMove
Load in the simulator to see the result

1a) With the iOS simulator loaded, hold the 'alt' key to reveal 'touch handles' (The grey circles you see)
2) Put the first touch over one of the squares, click and move it until the second touch is over the other square
3) Now you have the two simulated 'touches' over the objects and can try our your multi-touch
How do you limit touch commands so that you do not move certain objects in your app? For example, if you add in several gif images and do not want a background gif to be movable. For standard graphics, disabling the graphic locks it so it is immovable but I do not see this ability for a gif from the object properties stack.
- Mike