Slide Show

Written by: Headmaster
// Bromley College 
// Linden Script Exhibition
 
// Code for Step 30 Poster
 
integer counter = 0;
 
default
{
  state_entry()
  {
        llSetText("Touch for next slide", <0,1,0>, 3);
        //Set floating text
 
        llAllowInventoryDrop(FALSE); 
        //stop users from dropping their own textures onto the object
   }
 
        touch_start(integer total_number)          //when user touches object
        {
        llSay ( 0, "Texture identifier is:  " + (string)counter);
        //Output the contents of the counter on ch0
 
        string texture = llGetInventoryName(INVENTORY_TEXTURE, counter);
        //Get name of indexed texture
 
        llSay ( 0, "Texture name is: " + (string)texture);
        //Output the name of the texture on ch0
 
        llSetTexture(texture,3);
      // Display the texture on the front (side 3) of the object
 
      counter = counter + 1;
      // Point to the next texture in the object's inventory
 
      if (counter >= llGetInventoryNumber(INVENTORY_TEXTURE)) 
      // If all textures have been displayed
      {
          counter = 0; 
          // reset counter index and restart loop
      }
  }
}
 
// End of code;

 

Category: