Does anyone know of a way to create an outline around my text, a la Photoshop layer effect? Just increasing the size of a different label and drawing it underneath wouldn’t work unless I did it for each letter individually and laid them out one by one, pixel by pixel, but that’s pretty ridiculous.
Any method of using shaders, shadows, etc. that might work?
If you use GUIText objects, you can make a custom bitmap font that includes an outline. Otherwise, if this has to be in OnGUI, you can draw the text 5 times: shift left 1 pixel, right 1 pixel, up 1 pixel, down 1 pixel (all of these with the outline color), then finally in the normal position with the normal color. I think someone posted a routine somewhere that automated this.
I’m using GUIText objects, actually – I was hoping to avoid the pixel approach, so it’s nice that it appears I can.
How do I go about making the custom bitmap font? I already messed around with this but had poor results and figured it wasn’t possible. Basically I looked for a while for a font tool that allowed me to turn a TTF into a bitmap, then I wanted to open it in Photoshop to apply the outline effect. Unfortunately, Photoshop can’t read a BDF, or anything else that the font tool I got could export.
But in the end it seems I need to do this:
Export a TTF into a BDF.
Export the BDF into a format Photoshop can read like PNG.
Apply the outline to the PNG in Photoshop, save it.
Import the PNG to a BDF.
Put the BDF into Unity.
Potentially steps 1 and 2 can be combined if I find the right program.
In any case, can anyone point me to programs that can perform any or all of those steps, and/or tell me a better way to do this?
You don’t actually use the BDF format. A bitmap font in Unity is just a normal texture (PSD, Targa, PNG, etc). Unity expects to find the letters in a grid. You have to specify kerning per-character.
That’s a gigantic pain. It must take 2 hours to get all the values right for each letter. Here’s to hoping they improve this functionality in the future.
In practice it isn’t super painful. Could be a lot better. In Unity 2.1 you can no longer see the characters (you have to type in their ASCII character codes).
The secret is alt-clicking to expand all kerning values in the array and then right-click-dragging to adjust. Keep a GUIText with the whole alphabet in the scene.