x


How can I add font effects to my GUIStyle font?

I would like to add a drop shadow/border/glow/texture to the fonts used in my GUISkin.

I know you can use a script to save out the font texture, edit it and then apply it through a custom material (lots of posts on that). However, is there any way to customize the font used in UnityGUI (i.e. through a GUIStyle/Skin)?

more ▼

asked Sep 29 '10 at 07:42 PM

Molix gravatar image

Molix
4.8k 17 27 66

(comments are locked)
10|3000 characters needed characters left

3 answers: sort voted first

You can't, sorry; OnGUI functions use TrueType fonts only.

more ▼

answered Sep 29 '10 at 08:32 PM

Eric5h5 gravatar image

Eric5h5
80.3k 42 132 521

(comments are locked)
10|3000 characters needed characters left

We created a DropShadowText script that will draw two labels, one slightly offset and darkened behind another label. Rotten performance wise, but the only way to simulate such an effect.

At least in Unity 3.0, you can use dynamic fonts to resize, and bold/italicize. That's more than was available before.

more ▼

answered Sep 29 '10 at 09:20 PM

auzette gravatar image

auzette
114 6 10 14

(comments are locked)
10|3000 characters needed characters left

You can. Unity imports true type fonts and converts them into bitmaps (images). The idea is you extract that image as a file, edit it in your image editing tool like Photoshop, then put it back in.

http://www.unifycommunity.com/wiki/index.php?title=SaveFontTexture

Take note its not a good idea to add effects that go beyond the boundaries of the letters. Adding gradients or small drop shadows are fine.

more ▼

answered Mar 12 '11 at 09:03 AM

anomalous_underdog gravatar image

anomalous_underdog
335 3 6 18

That is one of scripts I referred to, but it is for GUIText/using a material, not OnGUI/GUIStyle objects.

Mar 12 '11 at 04:43 PM Molix
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3698
x241
x111

asked: Sep 29 '10 at 07:42 PM

Seen: 3459 times

Last Updated: Sep 29 '10 at 07:42 PM