Things I Like..

Four, Four, Four Textures in One

I am doing tech review for an upcoming book on Second Life and learned about the texture offset parameters last week. Basically, it is possible to set the origin of the image within the prim, so that the image “slides” across the face of the prim. I already knew that it was possible to set the image scale so that just a portion of the image would be shown. Putting 2 and 2 together, I figured that it would be really easy to tile 4 smaller images into a bigger image and then programmatically adjust the offset so that exactly one of the images would be shown at a time.

Drawing on my newfound knowledge of Photoshop, I created the following image using cover art taken from Amazon.com:

Every time the prim is clicked, the script uses the pair of offsets (X and Y) located at Offsets[ListOffset] and Offsets[ListOffset + 1]. It then steps ListOffset by two and wraps it around to 0 if necessary.