Time for action – making a racecourse
We're going to make a racecourse for little cars to move around. We'll make it out of the stack we've built! First, we need to convert what is on the card into an image that represents walls and spaces:
Using the LiveCode draw tools, add a bunch of objects to the
ImageDataTest
stack. These are going to be the obstacles in the racecourse.To create the image we'll need, type this in the message box:
import snapshot from rect the rect of this stack
The preceding command will take a screenshot of the card window and place it onto the card as a new image control. The new image will overlay the whole card, so will not be noticeable. You can confirm that the image was created and select it with the Project Browser.
Right-click on the image that was created and select Launch Editor. This will open the image in the bitmap editor that you have set in Preferences/General. You will be prompted by LiveCode to select an editor if you haven't previously done so.
In your...