Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

One prim HUD button with centered text

SuezanneC Baskerville
Forums Rock!
Join date: 22 Dec 2003
Posts: 14,229
03-31-2007 18:37
To make a one prim HUD button with centered text, try a cube with size X of .075, size Z of .01, rotation Y of 315, taper X of -1, topshear X of .5, llSetText("Button Text", <1,1,1>,1); .
_____________________
-

So long to these forums, the vBulletin forums that used to be at forums.secondlife.com. I will miss them.

I can be found on the web by searching for "SuezanneC Baskerville", or go to

http://www.google.com/profiles/suezanne

-

http://lindenlab.tribe.net/ created on 11/19/03.

Members: Ben, Catherine, Colin, Cory, Dan, Doug, Jim, Philip, Phoenix, Richard,
Robin, and Ryan

-
Darien Caldwell
Registered User
Join date: 12 Oct 2006
Posts: 3,127
03-31-2007 21:33
Nice work, a clever solution :)
Deanna Trollop
BZ Enterprises
Join date: 30 Jan 2006
Posts: 671
03-31-2007 21:56
I've tinkered with HUD buttons using floating text, and the vertical position of the text will vary from viewer to viewer depending on screen resolution settings, since the offset above center appears to be in pixels, rather than a function of object height.
SuezanneC Baskerville
Forums Rock!
Join date: 22 Dec 2003
Posts: 14,229
04-01-2007 01:50
This appear to produce reasonably well centered text at 800 by 600, 1024x768, and 1280x800.

The text is so nearly centered in the object image the resolution probably doesn't make a difference of more than a pixel or two, if that.
_____________________
-

So long to these forums, the vBulletin forums that used to be at forums.secondlife.com. I will miss them.

I can be found on the web by searching for "SuezanneC Baskerville", or go to

http://www.google.com/profiles/suezanne

-

http://lindenlab.tribe.net/ created on 11/19/03.

Members: Ben, Catherine, Colin, Cory, Dan, Doug, Jim, Philip, Phoenix, Richard,
Robin, and Ryan

-
Kenn Nilsson
AeonVox
Join date: 24 May 2005
Posts: 897
04-01-2007 02:07
Yes...if you rotate a prim so that the 'top' of the prim is facing you in the HUD, the floating text will not appear to move. The float seems to be 'above top' rather than 'above prim'
_____________________
--AeonVox--

Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms chasing ghosts, eating magic pills, and listening to repetitive, addictive, electronic music.
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
04-01-2007 05:59
The only drawback with rotated hud objects, is if you change the attachment hardpoint, it reverts to rotation 0,0,0. A solution night be to put a rotation command into the on_rez event, so the proper face is always facing the viewer, regardless of attachment point.
_____________________

● Inworld Store: http://slurl.eclectic-randomness.com
● Website: http://www.eclectic-randomness.com
● Twitter: @WinterVentura
Gearsawe Stonecutter
Over there
Join date: 14 Sep 2005
Posts: 614
04-01-2007 09:43
very nifty. now we just need llSetLinkText then we are all set.
Deanna Trollop
BZ Enterprises
Join date: 30 Jan 2006
Posts: 671
04-01-2007 13:12
From: SuezanneC Baskerville
This appear to produce reasonably well centered text at 800 by 600, 1024x768, and 1280x800.
Ah, forgot to mention... this will also be affected by the UI Size slider and Use resolution independent scale checkbox on the Graphics tab of the Preferences dialog.

With the box un-checked, UI elements (including floating text and the associated vertical offset) will be scaled to the multiple of their literal pixel size specified by the slider.

When checked, they will be scaled based on their physical screen size at 1024x768.

I suspect the box is checked in your preferences, Suzanne. Try un-checking it, and you'll probably see a quite noticeable difference in floating text font size and vertical positioning between resolutions.