Cylindrian's Tip/Info/Vending Sign (Part 6)
This is part six in a series of howto entries.
Appearance
We pretty much have all the scripts in place that we need for the object at this point. However we still have a minor issue, don't we? How do we get from this:
To this:
Root Prim Tweaks
First let's slap a little script in the root prim which I was provided by Bobby Fairweather. This will stop the hover text above the secondTUNES vendor object from showing. I named it "Suppress SetText on SecondTUNES Vendors"
t2API(string call_name, string value) {
//Basic version just for Brain
llMessageLinked(LINK_SET, 0, value, (key)call_name);
}
default
{
state_entry()
{
// Tell the secondTUNES portions of this object to turn the settext/hover text off
t2API("t2TopText","OFF"); // off to suppress, on to display text
}
on_rez(integer unused)
{
llResetScript();
}
}
Next we should make the root prim invisible. It serves no purpose other than to join the children together. If you do not have a transparent texture you can get one quite easily. Here's a UUID that should work as well: 3fb600c1-9f9a-f8e2-2338-ba87eed8b058 (although if you know what to do with that you likely already have a transparent texture).
Break Out Photoshop
You can use any background picture to texture your background prim. You'll probably want something at high contrast with the font color you choose.
To create the "button" prims that trigger the dialog menus I exported some targa files complete with alpha layers. I started by creating a new photoshop file that was 256x128 in RGB color space with a transparent background (Correction from screenshot - 8 bit depth, not 16).

Create Button Border
Next I created a new layer:

and called the new layer Button Border:

I clicked the rectangular marquee tool 
and made a section inside my new RGB mode file:

Then chose the Stroke... menu item in the Edit menu:

In the stroke window I set it to about 5 pixels, black in color, located in the center with 100% opacity.
We almost have a button outline now. We just need to apply some blending options for this layer.

The following screen shots depict the blending options I used and their settings (click for larger image).
Bevel and emboss:
Afterwards your layers will look like this:

and your document window should look like this:

Add Text
It's time to add some text for our button. Select the text tool and place the new cursor in the document - a new text layer will be created for you to write in. The text layer has a square T icon in it. The text in that layer can be edited anytime by double clicking the T icon which will highlight all of the text for you.

Also be sure that your character palette is open - under the window menu ensure that Character is checked. You can use the character palette to change the font, text color, alignment, etc.

Once you're done editing your text you'll probably want to reposition it. To do so click the move tool which should allow you to reposition the text block on your layer at will.

You should end up with something similar to this:

Create Alpha Channel
To preserve transparency we'll need to mask off the area of the picture that should remain transparent on save. First we'll create a background alpha channel that takes the button border into account. Then for each text button we create we'll have to add and then subtract the text outline to/from that same alpha layer.
Make sure that the button border layer is highlighted (has the paintbrush/edit icon showing) and that you have the move tool selected 
Select all by going to the edit menu and choosing select all (cmd-a on Mac). You'll get "marching ants" (Chicki Bukowski's term, I love it) showing that there is a selection all the way around the window contents.

Press the right arrow key on your keyboard once. The marching ants now cover the border graphic, not the edges of the window. Press the left arrow key once to move the border back to where it was. You've now got a selection around the area that needs to be masked.

Choose "Save selection..." from the Selection menu.

In the new save selection dialog that pops up choose to create a new channel, name it AlphaBG and click OK.
If you look at your channels palette (Window -> Channels) you'll see the new channel is there - the black area represents the masking where the image will be transparent.

Render the Text, Mask the Text
We still have a small issue though. The text of our button was not added to the alpha background channel. That means if we save our file for export to Second Life (registered trademark of the very safe company Linden Labs) now our text will be hidden!
We have to do something called rasterizing the text. Meaning take a text layer and turn it into a bitmap that can be manipulated like our button border was. First, I like to duplicate my text layer for safe keeping.

Then turn the eye icon off on one of the text layers - this is your backup which we don't need to see right now. On the other layer highlight it and ensure that the paibrush/edit icon is present for that layer. Click the Layers menu, go to Rasterize and select Type.
You'll end up with a text layer that hidden and a text layer that has been converted to editable paint. Notice that the T square icon is gone from the layer and that there is a representation of the content of that layer - just the text over transparent background.

What we'll need to do is select the outline of the text, then save that selection into our AlphaBG channel. Want to guess how we do this? That's right, you repeat the above steps.
- Select All
- Ensure you have the move tool selected
- Click left arrow then right arrow, selection now around the text itself

- Choose Save selection... from the selection menu
This time you want to save TO the AlphaBG channel, not create a new one. You want to Add instead of replace.
Check your channel palette again. See anything new? Like the text showing in the middle of the button?

Save as Targa
The image you upload to Second Life should be a targa file type. So choose Save as... from the File menu, select your save location, and from the drop down select Targa as the file type. Ensure that the checkbox is on to save alpha.
When prompted ensure that you choose 32 bits/pixel. This preserves the alpha channel - anything less will strip that data out.

Prepare For Next Text Layer
Don't forget to go back and subtract your selection from the AlphaBG channel once you have saved your targa file. This will prepare you for the next text layer if you're making more than one button.
Upload
Now open Second Life, hit cmd-U, select your new targa file and upload that texture! Next apply it to the child prim of your choice with corresponding dialog menu preference file and BOOM - SHABAMMM - BLAMM and KAZAA.
Tweak Prim Sizing and Position
Finally you have all the prims textured. The buttons have an outline and text, the root prim is invisible, the background prim has the tip jar script and a pretty picture. Once you organize the primsas they relate to each other to make that pretty presentation I'll have to say "Congratulations! You've made it to the end".
Thanks to Cylindrian for giving me a fun project to work on.
Thanks to you for reading - I hope you found this series helpful in some way.
Have the sponsored links in my sidebar been helpful at all?
Bonus Downloads
Just in case you may find them helpful here is the photoshop file I used in creating this section as well as an example targa output file: