The handlers so far have been in the card script, the plan being to have different cards with different types of puzzle. The interactivity handlers can be placed in the stack script available for all the cards.
Open the stack script. There is only one of the global variables that we will also need in the stack script, but there are a couple of initializing items we need to cover. Start the stack script with these lines:
global snapdistance on preopenstack if the platform contains "iphone" then iphoneUseDeviceResolution true end preopenstack on openstack set the compositorType of this stack to "Static OpenGL" end openstack
The
preopenstack
handler checks whether the app is on iPhone and requests that the device's native resolution be used. This will make sure that Retina displays show the best quality. ThecompositorType
being set to"Static OpenGL"
will help performance.The interactivity we'll use will make use of touch events. Each touch comes...