|
Thorne Kaiser
Nice Guy
Join date: 29 Nov 2005
Posts: 132
|
02-08-2006 11:51
I am using the parent/child texture changer. Works great. Now I am trying to use a menu to change the textures. In the parent prim, the following code was used to change the textures: Never mind, got it 
|
|
Ziggy Puff
Registered User
Join date: 15 Jul 2005
Posts: 1,143
|
02-08-2006 13:27
// This is where you declare the function. This is what the function does setLinkTexture(integer linkNumber, string textureKey, integer side) { llMessageLinked(linkNumber, side, textureKey, "setTexture" ; }
integer currentTexture; default { touch_start(integer totalNum) { string textureName = llGetInventoryName(INVENTORY_TEXTURE, currentTexture); if (textureName != "")
// This is where you call/use the function setLinkTexture(LINK_SET, textureName, ALL_SIDES); integer numTextures = llGetInventoryNumber(INVENTORY_TEXTURE); if (curTexture < numTextures) { // If we have more textures. ++curTexture; // Go to the next one. } else { curTexture = 0; // Go to the beginning of the list. } }
You define the function once, at the top. Then you call it whenever you need that code to be executed. So all you need to do is call the function when you get the menu string... if (str=="MPLAIN|1st Texture") { // This line sets the parent prim's texture llSetTexture("mytexture1", ALL_SIDES);
// This line sets the child prim's texture llSetLinkTexture("mytexture1", ALL_SIDES); } else if (str=="MPLAIN|2nd Texture") { // This line sets the parent prim's texture llSetTexture("mytexture2", ALL_SIDES);
// This line sets the child prim's texture llSetLinkTexture("mytexture2", ALL_SIDES); } ...
|
|
Thorne Kaiser
Nice Guy
Join date: 29 Nov 2005
Posts: 132
|
02-08-2006 13:30
Oh thx Ziggy! I figured everyone was a lil busy so I put my brain in the microwave and somehow got it! I really do appreciate your posting to help me!!
Hugs, Thorne
|