By setting the chosen image to be of the same width and height as the group that holds the puzzle pieces (that's where the 900 and 662 numbers came from), it becomes possible for us to transfer the matching rectangle of data from the full image to the puzzle piece in question. The following steps will guide you in transferring imageData:
Open the card script again. Add the
makepuzzle
handler:on makepuzzle resetpuzzle put the number of images in group "pieces" into imagecount repeat with a = 1 to imagecount makepiece the short name of image a of group "pieces" end repeat end makepuzzle
The
makepuzzle
handler will go through each of the puzzle pieces and call another handler to do the transfer of data for that one piece. Here is themakepiece
handler:on makepiece piecename put the width of image piecename into piecewidth put the height of image piecename into pieceheight put empty into tempimage put the left of image piecename - the...