Difference between revisions of "Creating HUDs"
m |
(Not all HUDs are control panels) |
||
Line 1: | Line 1: | ||
{{Help |Glossary=*|BugFixes=*}} | {{Help |Glossary=*|BugFixes=*}} | ||
[[Image:Attach HUD.png|frame|Right-click an object in inventory and choose '''Attach to HUD''' > ... to make it a HUD]] | |||
In Second Life, every [[object]] can become a '''[http://en.wikipedia.org/wiki/HUD_%28video_gaming%29 heads-up display]''' ('''HUD''' for short) by attaching it to one of the eight HUD attachment points. Other than objects [[attachment|attached]] to "normal" attachment points, HUDs will not show up on the Avatar's body, but instead on the user's screen. Only the user wearing them can see them, but chat [[:Category:LSL_Chat|emitted]] by them will be visible to other users and other objects. | |||
== Common Uses == | |||
HUDs are often used as informational displays (e.g. a sim radar, or a health-meter for inworld combat systems) or as control panels for [[Animation_Override]]s, scripted attachments (e.g. recolorable prim clothes/shoes/hair, animated neko tail/ears) or other devices. | |||
== Scripting HUDs == | |||
Most scripted functionality works with HUDs, with the following exceptions. (The list is not exhaustive!) | Most scripted functionality works with HUDs, with the following exceptions. (The list is not exhaustive!) | ||
Revision as of 16:21, 17 March 2010
Help Portal: |
Avatar | Bug Fixes | Communication | Community | Glossary | Land & Sim | Multimedia | Navigation | Object | Video Tutorials | Viewer | Wiki | Misc |
In Second Life, every object can become a heads-up display (HUD for short) by attaching it to one of the eight HUD attachment points. Other than objects attached to "normal" attachment points, HUDs will not show up on the Avatar's body, but instead on the user's screen. Only the user wearing them can see them, but chat emitted by them will be visible to other users and other objects.
Common Uses
HUDs are often used as informational displays (e.g. a sim radar, or a health-meter for inworld combat systems) or as control panels for Animation_Overrides, scripted attachments (e.g. recolorable prim clothes/shoes/hair, animated neko tail/ears) or other devices.
Scripting HUDs
Most scripted functionality works with HUDs, with the following exceptions. (The list is not exhaustive!)
- Particles do not work. Don't have HUD prims generate them. If a HUD attempts to generate particles, they appear at <0,0,0> in the current sim, annoying your neighbors.
- If a sound is triggered using llPlaySound(), only the HUD wearer will hear it. If the land parcel they're over restricts sound entry/exit, the sound will not play.
- If a sound is triggered using llTriggerSound(), the wearer and any bystanders will hear it.
- The Sensor will not detect the avatar wearing the HUD.
Scripted movement of HUD pieces is relative to the attachment points. The position vector used by llSetPos() is interpreted as [DESCRIPTION MISSING!]. A depth of -1 will render in front of a depth of 0.
Since HUD attachments cannot be clicked thru even if they're invisible, the common solutions to getting them out of the way are moving them and shrinking them.
If you are trying to move the HUD around relative to its current position, use llGetLocalPos() rather than llGetPos().
example:
<lsl>llSetPos(llGetLocalPos() + (<0.25,0,0> * llGetLocalRot()));</lsl>
Solving problems with HUDs
HUD is invisible
This problem arises when the person who made the HUD (or gave it to you) has a screen resolution greater than yours: The HUD is attached at the position that it had on their screen, but that is outside your field of view. The solution is:
- Attach another HUD (one that you know works properly for you).
- Right-click it and select "Edit".
- Zoom out until you can see the other HUD.
- Left-click on the stray and move it back within the white rectangle marking your viewer's screen size. Note: use the arrowheads to move the HUD, clicking on the arrows' tails sometimes drops you out of edit mode.
- Close the Edit window to return to normal viewing.
This will only bring the HUD back into view temporarily. Once you close the HUD and reopen it, the problem will repeat itself.