Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Labels for Hud Buttons and maybe other questions

SuezanneC Baskerville
Forums Rock!
Join date: 22 Dec 2003
Posts: 14,229
02-26-2006 17:06
I am playing with making a very simple HUD to control animations.

I have at present 4 cubes in a row, linked, as my HUD.

One cube is red, it's the stop button and is the main button because it does the actual stopping and starting of animations and it also holds the animations.

The other cubes are the buttons used to start the animations. When you click one them, it sends a link message to the main cube, which then stops the previously selected animation and starts the newly selected animation.

The main cube loops through it's inventory at an early stage in the process, sending link mesages with animation names to the controller buttons, which then display these names with llSetText.

My question is what is the best way to have the settext appear on top of a prim to click on instead of floating above the prim.

I can see how to do it in a simple way, just use an extra row of prims, one for dispaying the names and the other for clicking on, but this seems like a stupid way to have to do things.

Obviously one could make textures with the names of the animations but that is a pain.

Is there a clever, sneaky way around this?
_____________________
-

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

-
Aliasi Stonebender
Return of Catbread
Join date: 30 Jan 2005
Posts: 1,858
02-26-2006 17:33
From: SuezanneC Baskerville
Obviously one could make textures with the names of the animations but that is a pain.

Is there a clever, sneaky way around this?


I haven't tried (since I always make a prim especially for the llSetText), but perhaps some clever combination of cutting a prim in half and stretching (since it appears at a set distance from the center)?

I'll have to experiment.

EDIT: it works with something like top shear on a cube well enough.
_____________________
Red Mary says, softly, “How a man grows aggressive when his enemy displays propriety. He thinks: I will use this good behavior to enforce my advantage over her. Is it any wonder people hold good behavior in such disregard?”
Anything Surplus Home to the "Nuke the Crap Out of..." series of games and other stuff
Exile Loudon
Aspiring Scripter
Join date: 10 Dec 2005
Posts: 122
02-26-2006 18:16
You can try using the llSetText script and moving around the location of the text. Try changing around the vector coordinates.
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
02-26-2006 19:14
doesnt matter what the text is, its gonna be set something above the prim

From: someone
The text will always be positioned to float straight up (parallel to the world's Z-axis) from the prim's center, at a distance of half the prim's Z scale plus some fixed offset.


and the only vector in set text defines color

llSetText(string text, vector color, float alpha)
Exile Loudon
Aspiring Scripter
Join date: 10 Dec 2005
Posts: 122
02-27-2006 02:36
Oh, I had thought llSetText used coordinates to choose where it goes.
Patch Lamington
Blumfield SLuburban
Join date: 2 Nov 2005
Posts: 188
02-27-2006 04:37
From: Aliasi Stonebender

I'll have to experiment.

EDIT: it works with something like top shear on a cube well enough.


Good thinking... gave it a quick try myself.

Rotated the prim round y first (45 degrees I tried), the set top shear x to -50.
With some tweaking, might be possible to get text more centrally positioned in vertical axis.

Almost certainly going to use this in future.

I was going to post a pic, but no option to do so :(
_____________________
Blumfield - a regular everyday kind of 'burb in an irregular world.
This notice brought to you by the Blumfield Visitors and Residents Bureau.
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
02-27-2006 04:41
I just use two prims. One small full alpha one, which has the float text script, and the other the background one. When I attach the HUD device I edit it and move the float text prim around until it's properly aligned.

edit: which is your "obvious way" above... but I couldn't find a good way to easily combine nice textures on the background with any other method
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
02-27-2006 09:47
From: Exile Loudon
Oh, I had thought llSetText used coordinates to choose where it goes.


I wish :)
Logan Bauer
Inept Adept
Join date: 13 Jun 2004
Posts: 2,237
02-27-2006 09:51
For the DarkLife Hud and other recent hud things I've done, I did basically what Aliasi said - take a single prim and cut it and rotate it until the text appears on top of the button, this has worked great for me. Tho I didn't have to sheer them at all if I remember right, just adjusted the cut so that the bottom 1/2 of the cube only remained, and then flipped it upside down... If nobody else beats me to it I'll try to post the exact process when I get home, if necessary.