« New Site Category Created | Main | Annoyances »

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:

ModifiedTestObject.jpg

To this:

GraceFinalTipJar.jpg

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).

NewPhotoshopDoc.jpg

NewButtonsWindow.jpg

Create Button Border

Next I created a new layer:

NewLayer.jpg

and called the new layer Button Border:

ButtonBorderLayerAdded.jpg

I clicked the rectangular marquee tool RectMarquee.jpg

and made a section inside my new RGB mode file:

SelectSquare.jpg

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

EditMenuStroke.jpg

In the stroke window I set it to about 5 pixels, black in color, located in the center with 100% opacity.

StrokeDialog.jpg

We almost have a button outline now. We just need to apply some blending options for this layer.

BlendingOptions.jpg

The following screen shots depict the blending options I used and their settings (click for larger image).

Bevel and emboss:

BO_BevelEmboss.jpg

Color overlay (gray):
BO_ColorOverlay.jpg

Inner glow:
BO_InnerGlow.jpg

Outer glow:
BO_OuterGlow.jpg

Afterwards your layers will look like this:

BO_LayerWithOptions.jpg

and your document window should look like this:

BO_WindowAfterApplication.jpg

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.

TextTool.jpg

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.

CharacterWindow.jpg

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.

MoveTool.jpg

You should end up with something similar to this:

NewText.jpg

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 MoveTool.jpg

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.

MarchingAntsWindow.jpg

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.

MarchingAntsBorder.jpg

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

SaveSelection.jpg

In the new save selection dialog that pops up choose to create a new channel, name it AlphaBG and click OK.

AlphaBG.jpg

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.

AlphaBGChannel.jpg

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.

DuplicateLayer.jpg

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.

LayerRasterizeText.jpg

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.

RasterizedTextLayer.jpg

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

MarchingAntsText.jpg

- 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.

AddToChannel.jpg

Check your channel palette again. See anything new? Like the text showing in the middle of the button?

AlphaBGWithText.jpg

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.

SaveAsTarga.jpg

When prompted ensure that you choose 32 bits/pixel. This preserves the alpha channel - anything less will strip that data out.

SaveAsTarga32.jpg


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.

SubtractFromChannel.jpg


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:

NewButtons photoshop file with layers

NewButtons targa file - example export file

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

Recent Comments

Melynn said: The purple/pink guitar is in small pieces now, so it's a toad-ily mute point anyway. :) That's even more amusing.…

Crap Mariner said: You know, it would be amusing to have the equivalent of a Turing Test to see if people could figure out if a stream of chat is actually from me or if it's from …

Dolmere Talamasca said: One might note that the JIRA bug now has 650 votes for it. Keep 'em coming people, it's easy to login and add your vote if you think something like this is need…

Dolmere Talamasca said: Interesting way of looking at it, Vint. I would think more PA than PS but unpaid labor is still unpaid labor.…

Dolmere Talamasca said: Instead of the typing animation use "UISndTyping" and clear the field to accomplish the closest thing to what I'm looking for (As noted by Jacek at Crap Mariner said: *shrug* Got time to hit the tower on Monday with Cyl and SUPRISE SPECIAL GUEST? Not sure which song... um... Rainbow Connection would be cool basstasstically…