Jump to content

Hide HUD button.


Tattooshop
 Share

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

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

Recommended Posts

Moving it off the screen might not be a great idea because you'll have a hard time bringing it back. The typical solutions are to either rotate the HUD so that you are looking at a much narrower edge, or move child prims behind the root, or shrink them so that they are behind the root.  Personally, I have always found it easiest to rotate the whole HUD, but it all depends on the geometry and complexity of the linkset.

  • Thanks 1
Link to comment
Share on other sites

I know you said the HUD was a linkset, which is certainly the easiest way to build one, but have you considered making it a planar mesh, either using different materials assigned to faces that act as placeholders for your buttons and llDetectedFace to determine which one was clicked or using a single face with llDetectedTouchST or llDetectedTouchUV  to determine arbitrary regions of the face or texture that can be buttons or not depending on the context in the script? Then hiding a button is just a matter of changing a texture and having whether clicking there actually does anything or not totally under the control of the script. Personally I've found one of these approaches to offer greater flexibility when the HUD has to "change context" in normal operation, albeit requiring a little more care in scripting it.

When hiding the entire HUD, of course a rotated planar mesh will occupy zero area on teh screen and be totally invisible. (and unclickable, but a tiny face at right angles to the rest of it will give you a very small "click to bring it back" area)

 

Edited by Da5id Weatherwax
  • Thanks 1
Link to comment
Share on other sites

1 hour ago, Rolig Loon said:

Moving it off the screen might not be a great idea because you'll have a hard time bringing it back. The typical solutions are to either rotate the HUD so that you are looking at a much narrower edge, or move child prims behind the root, or shrink them so that they are behind the root.  Personally, I have always found it easiest to rotate the whole HUD, but it all depends on the geometry and complexity of the linkset.

Thank you! Yes, most likely I will use the rotation. but just in case I’m trying an option with a sliding off the screen too. part of it will remain on the screen.
but I have two problems. Hud moves too high even with a small value. and how to return the hud back to move in the opposite direction?

 default
 {
     state_entry()
     {
         //
     }

     touch_end(integer total_number)
     {
         integer hide = llDetectedLinkNumber(0);
         {
             if (hide == 3)
             {
                 llSetPos(llGetPos() + <0,0,0.001>);
             }
         }
     }
 }

 

Link to comment
Share on other sites

1 hour ago, Da5id Weatherwax said:

I know you said the HUD was a linkset, which is certainly the easiest way to build one, but have you considered making it a planar mesh, either using different materials assigned to faces that act as placeholders for your buttons and llDetectedFace to determine which one was clicked or using a single face with llDetectedTouchST or llDetectedTouchUV  to determine arbitrary regions of the face or texture that can be buttons or not depending on the context in the script? Then hiding a button is just a matter of changing a texture and having whether clicking there actually does anything or not totally under the control of the script. Personally I've found one of these approaches to offer greater flexibility when the HUD has to "change context" in normal operation, albeit requiring a little more care in scripting it.

When hiding the entire HUD, of course a rotated planar mesh will occupy zero area on teh screen and be totally invisible. (and unclickable, but a tiny face at right angles to the rest of it will give you a very small "click to bring it back" area)

 

Yes thanks! I would do just that too, but I didn’t do the hud itself and I can’t do anything about it :D

Link to comment
Share on other sites

37 minutes ago, Tattooshop said:

Hud moves too high even with a small value. and how to return the hud back to move in the opposite direction?

Don't use llGetPos.  Instead, move the HUD's local position, as in 

llSetPos(llGetLocalPos() + (<0.25, 0.0, 0.0> * llGetLocalRot()));

Then, subtract the offset amount to move it back.  If you haven't discovered it already, you may want to review design considerations at http://wiki.secondlife.com/wiki/Creating_HUDs

  • Thanks 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1531 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...