Advertisement
worstbull

Untitled

Sep 10th, 2014
292
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. integer iButtonCount = 16;
  2. integer iPictureFrameRows = 4;
  3. integer iPictureFrameColumns = 5;
  4. integer iTouchFace = 1;
  5.  
  6.  
  7. string sButton = "Button #";
  8. fButton(integer i)
  9. {
  10.     llWhisper(PUBLIC_CHANNEL, sButton+(string)i);
  11. }
  12. default
  13. {
  14.     state_entry()
  15.     {
  16.     }
  17.  
  18.     touch_start(integer total_number)
  19.     {
  20.         vector vPUV = llDetectedTouchST(0);
  21.         if (llDetectedTouchFace(0) == iTouchFace)
  22.         {
  23.             integer iHorizontal = llFloor(iPictureFrameRows*vPUV.x);
  24.             integer iVertikal = llFloor(iPictureFrameColumns* (1-vPUV.y));
  25.             integer iBild = 1 + iHorizontal + iVertikal * iPictureFrameRows;
  26.             if (iBild <= iButtonCount)
  27.             {
  28.                 fButton(iBild);
  29.             }
  30.         }
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement