I have created a simple script to demonstrate the problem. Just build two prims, link them, toss the script in the root, and attach to the HUD. The script will handle the rest. Speak 'show' on channel 0 and the child prim will move into view. Speak 'hide' and the child prim will move out of view. Detach and attach to reset.
You will notice that before the first 'show', you are able to touch normally. Once you show the child prim, any touch in that area will register on the child, even if it is moved out of view with 'hide'.
I have tried lots of things to solve the problem. I tried using llSetText after a move from in the root and the child prim. I tried moving the child prim from inside the child with llSetPrimitiveParams. I tried using llSetPos in the child. Nothing seems to matter. The child always seems to leave a 'ghost' image in way.
Any suggestions?
Thanks so much
CODE
default
{
state_entry()
{
llListen(0, "", llGetOwner(), "");
}
// On attach to the HUD, setup the parts for the test
// Root prim is the sphere, child is the box
attach(key attached)
{
if (attached != NULL_KEY)
{
if(llGetAttached() > 30)
{
llSetLinkPrimitiveParams(1, [PRIM_POSITION,
<0.0, 0.0, 0.0>,
PRIM_TYPE,
PRIM_TYPE_SPHERE,
0,
<0.0, 1.0, 0.0>,
0.0, <0.0, 0.0, 0.0>,
<0.0, 1.0, 0.0>]);
llSetLinkPrimitiveParams(2, [PRIM_POSITION,
<0.0, 0.0, 0.0>,
PRIM_TYPE,
PRIM_TYPE_BOX,
0,
<0.0, 1.0, 0.0>,
0.0,
<0.0, 0.0, 0.0>,
<1.0, 1.0, 0.0>,
<0.0, 0.0, 0.0>]);
llSetLinkPrimitiveParams(1, [PRIM_POSITION, <0.0, 0.0, 1.0>]);
}
}
}
touch_start(integer total_number)
{
llSay(0, "HUD was touched");
}
listen(integer channel, string name, key id, string message)
{
// move child prim into view on "show"
if(message == "show")
{
llSetLinkPrimitiveParams(2, [PRIM_POSITION, <0.0, 0.0, -1.0>]);
}
// move child prim out of view on "hide"
else if(message == "hide")
{
llSetLinkPrimitiveParams(2, [PRIM_POSITION, <0.0, 0.0, 0.0>]);
}
}
}