Jump to content

Simple HUD movement 12 Total Prims 10 Buttons for options


Jacob Forsythe
 Share

You are about to reply to a thread that has been inactive for 3542 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Howdy do all.

 

I am making a HUD (12 prims and one control prim for the movement).

I have 1 prim as the backing and 10 prims as buttons with 1 prim as the slider control.

What I am trying to do, is make the HUD slide on and off the side of the screen with one button showing (Attached to the side of the HUD), when this prim is clicked, the HUD should move onto the screen, and when clicked again, it should move off of the screen.

I am using the llGetPrimitiveParamsFast from this url: http://wiki.secondlife.com/wiki/LlSetPrimitiveParams#Examples

default
{
    touch_start(integer total_number)
    {
        integer numberOfPrims = llGetNumberOfPrims();
 
        if (numberOfPrims < 2) return;
 
        vector  link_pos;
        list    params;
 
        integer link = 2;// start with first child prim
        do
        {
//          get a child prim's local position (i.e, relative to the root prim)
            link_pos = llList2Vector(llGetLinkPrimitiveParams(link, [PRIM_POS_LOCAL]), 0);
 
            link_pos.z += 0.25;// relative to root's local z-axis !!!
 
            params += [PRIM_LINK_TARGET, link,
                            PRIM_POS_LOCAL, link_pos];
        }
        while (++link <= numberOfPrims);
 
        if (!llGetListLength(params)) return;
 
//      the params list starts with a PRIM_LINK_TARGET (a hack so we can start
//      with the first child prim), so it doesn't really matter which number you
//      put as first parameter in this function call
        llSetLinkPrimitiveParamsFast(2, params);
    }
}

 

(I may have the wrong function for what I am trying to do)

I have tried several options, else, if, else if and others, as well as adding and removing snipets of code.

All I can get this thing to do, is raise up and not come back to it's original position. The Root prim stays where it's supposed to, but the others move UP and continue to move up on each left click.

 

Any way to get those buggers back down where they originated from?

 

Thanks a lot!

Jake

 

P.S.

You can reach me inworld if need be.

Thanks! :matte-motes-big-grin-wink:

Link to comment
Share on other sites

It's late to think of this, of course, bu the easiest solution (and the least prim-heavy) would have been to use a single texture for the 10-button face of your HUD and then use llDetectedTouchST to define hot areas on it.  That would have saved you all the challenge of moving prim buttons around. 

Link to comment
Share on other sites

Thanks for the fast reply. I never can see peoples names with all these avatar pics.

Rolig.

That's interesting, that code is from the wiki of sl... lol.. I will try that and see what happens.

Also, I'm not really concerned about the texture bit, just trying to get the prims to move (accomplished) and move BACK where they started.

 

Also I am trying to move the whole linkset at one time, then back. The 10 buttons and the backng all at once. That can be done right?

Go get some coffee and a toast :)

Jake

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3542 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...