Another approach that could be taken to show increasing numbers of images is to make use of tiled images. The same visual effect as in the previous recipe can also be achieved by making use of a tiled gray star image with a width of 400 (showing four copies of the gray star icon) behind a tiled yellow star image, whose width is 100 times the number of stars collected.
If the yellow-starred image is less wide than the gray-starred imaged beneath, then we'll see gray stars for any remaining locations. For example, if we are carrying 3 stars, we'll make the width of the yellow-starred image 3 x 100 = 300 pixels wide. This will show 3 yellow stars and reveal 100 pixels; that is, 1 gray star from the gray-starred image beneath it.
To display gray and yellow star icons for multiple object pickups using tiled images, let's adapt our recipe to illustrate this technique:
- In the Hierarchy window, delete...