Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

HUD Button Text

Mereille Despres
Registered User
Join date: 5 Sep 2007
Posts: 79
07-15-2008 06:31
I've seen a few thread on this topic, but I am still having problems.

I would like to put simple text on a button, or box in a hud.

I don't really want to use the Xytext for this one. The hud should have between 8-10 separate buttons, each with it's own text that will change based on the hud's inventory. That is a lot of textures to load, and a lot of display scripts.

But for some reason, I can't seem to get llSetText() to put the text on the button, it is always floating above it, even when attached to a hud point. From earlier posts, I had the impression that for HUD's llSetText() could place the text on a prim. Any help would be very appreciated. :)

Mereille
Atom Burma
Registered User
Join date: 30 May 2006
Posts: 685
07-15-2008 06:39
Has this worked in the past for you? There was a failure in all text this past weekend. Mostly floating text, that sort, lost it's attributes, grid wide, something happened, not sure why.
Mereille Despres
Registered User
Join date: 5 Sep 2007
Posts: 79
07-15-2008 06:45
Through the 'law of amazing coincidence', this weekend is when I started working on this part of the hud. So, no. I have never tried to have a hud display simple text directly on a button.

::gasp:: *I* broke SL! :boggle:
Thickbrick Sleaford
Baffled
Join date: 28 Dec 2006
Posts: 26
07-15-2008 08:56
You can use a cube prim for the button: make its sides transparent, cut it in half (so that the remaining half is above the centerpoint), and use skew to adjust the position of the front face of the cube to be aligned with the text. The only problem I can see is the position of the text will change when the HUD is resized.

Also, xyzzy-text uses only one script (though you can add more scripts to make it faster), to set text on many linked prims.
Deanna Trollop
BZ Enterprises
Join date: 30 Jan 2006
Posts: 671
07-15-2008 10:35
From: Thickbrick Sleaford
The only problem I can see is the position of the text will change when the HUD is resized.
It's worse than that (He's dead, Jim! No no no, wrong quote.) The vertical offset of floating text is a fixed pixel distance for a given prim Z size and UI scale, regardless of how large the prim is on the screen (even attached to the HUD). i.e., if you line up a prim to its floating text at full screen window size, then shrink the window, the prim will shrink accordingly, but the text won't, nor will it's offset, hence the text will now appear too large and too high for the prim. So the actual alignment of text to prim will vary from client to client (or moment to moment, even) depending on screen resolution, window size, and UI scale.

I've been working (intermittently) on a HUD system using floating text, and the only way I've come up with to ensure alignment is to have each new user go through a setup routine which establishes what the offset is on their particular screen, then scale the HUD prims accordingly so everything lines up (with the caveat that the user will have to do this again if they change window size and/or UI scale).