place this script in a prim and it will texture itself with a grid of 100 spaces.
touch any one of the numbers on any side and it will know and tell you exactly which one you press on the side you pressed it on.
this could easily be modified to handle more then 100 spaces with little effort.
//////////////////////////////////////////////////////
//Multi Touch Sensitive Prim - By Kain Cleaver
//FREE to use Script - All i ask is you credit
//me in your work if you decide to use this
//or major parts of this script in your work
//////////////////////////////////////////////////////
vector touchie;
float lr0 = .00;
float lr1 = .10;
float lr2 = .20;
float lr3 = .30;
float lr4 = .40;
float lr5 = .50;
float lr6 = .60;
float lr7 = .70;
float lr8 = .80;
float lr9 = .90;
float lr10 = 1.0;
float ud0 = .00;
float ud1 = .10;
float ud2 = .20;
float ud3 = .30;
float ud4 = .40;
float ud5 = .50;
float ud6 = .60;
float ud7 = .70;
float ud8 = .80;
float ud9 = .90;
float ud10 = 1.0;
float updown;
float leftright;
integer mark1;
integer mark2;
integer pos;
string side;
det()
{
if (updown > ud0 && updown < ud1){mark2 = 1;}
if (updown > ud1 && updown < ud2){mark2 = 2;}
if (updown > ud2 && updown < ud3){mark2 = 3;}
if (updown > ud3 && updown < ud4){mark2 = 4;}
if (updown > ud4 && updown < ud5){mark2 = 5;}
if (updown > ud5 && updown < ud6){mark2 = 6;}
if (updown > ud6 && updown < ud7){mark2 = 7;}
if (updown > ud7 && updown < ud
{mark2 = 8;}if (updown > ud8 && updown < ud9){mark2 = 9;}
if (updown > ud9 && updown < ud10){mark2 = 10;}
if (leftright > lr0 && leftright < lr1){mark1 = 0;}
if (leftright > lr1 && leftright < lr2){mark1 = 10;}
if (leftright > lr2 && leftright < lr3){mark1 = 20;}
if (leftright > lr3 && leftright < lr4){mark1 = 30;}
if (leftright > lr4 && leftright < lr5){mark1 = 40;}
if (leftright > lr5 && leftright < lr6){mark1 = 50;}
if (leftright > lr6 && leftright < lr7){mark1 = 60;}
if (leftright > lr7 && leftright < lr
{mark1 = 70;}if (leftright > lr8 && leftright < lr9){mark1 = 80;}
if (leftright > lr9 && leftright < lr10){mark1 = 90;}
pos = mark1 + mark2;
side = (string)llDetectedTouchFace(0);
llSay(0,"Touched Square : " + (string)pos + " On Side : " + side);
llMessageLinked(0,pos,side,NULL_KEY);
}
default
{
state_entry()
{
llSetTexture("3245bcf1-f721-52ec-2895-ea6d3909c7ed",ALL_SIDES);
}
touch_start(integer total_number)
{
touchie = llDetectedTouchST(0);
if (llDetectedTouchFace(0) == -1){llInstantMessage(llDetectedKey(0),"Incorrect SL Version - Please Update your Second Life Client to Most Recent Version To Take Advantage Of This Touch Interface"
;}else{
leftright = touchie.y;
updown = touchie.x;
det();
}
}
}
//////////////////////////////////////////////////////////////
//End Script
//////////////////////////////////////////////////////////////
The script automaticly link messages the side of the prim
and the number zone that was touched.
i was able to quickly make a 10 button color changer using this
by having the main script define the area touched and what color
it turned to by pressing that range.
if anyone needs the grid jpg for photoshop you can find it here
http://http://members.aol.com/mrcuddlemonstr/100grid.jpg
you can make this into a transparent layer and place your buttons
over the numbers you wish to define.. so if you place a button on
zones 1 2 3 and 4 simply define the link message as such
link_message(integer link_num,integer num, string str, key id)
{
if (num > 0 && num < 5){do action here}
}
hope i made it easy enough to understand. if you have questions feel free
to IM me. Kain Cleaver and ill help as much as i can
enjoy , take care and have fun
