x


Draw Particles over Text (GUIText or GUI.Label)

Hi!

Is there any way to draw a particle effect, using e.g. ParticleSystem, to draw it over text drawn using either GUIText or GUI.Label?

I need to move a particle effect over a text the user selects, and need to draw it over the text as it looks kind of strange being drawn behind the text...

Or perhaps someway of turning text into a texture, and drawing it as a normal gameobject behind the particles or something?

Thanks! :)

more ▼

asked Jun 07 '10 at 04:01 PM

TMK gravatar image

TMK
60 7 7 13

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

3 answers: sort voted first

You have to use more than one camera: put the particle system on a layer of its own, which is drawn by a camera that only shows that layer, and has clear flags set to depth only. This camera should have a higher depth so it draws on top of the camera that has the GUIText, and the particle system camera shouldn't have a GUILayer component. This will only work with GUIText/GUITexture and not OnGUI functions, which seem to be drawn on top of everything regardless. There's an answer around somewhere which explains the camera setup in more detail if you need that.

more ▼

answered Jun 07 '10 at 05:11 PM

Eric5h5 gravatar image

Eric5h5
80.2k 41 132 521

Ahh, that works nicely, thanks! :)

Jun 07 '10 at 11:50 PM TMK

there's some step by step tutorial for that? I have the same problem!

Jan 05 '12 at 07:28 PM DarkSlash
(comments are locked)
10|3000 characters needed characters left

I don't think there is a way to do specifically what you ask for (although I haven't tried the render to texture approach personally), but you could do it by making your text out of a text mesh. You'll have to use a different shader for your text mesh material so it gets sorted properly instead of drawn on top of everything always. There's an example of one here.

more ▼

answered Jun 07 '10 at 04:17 PM

Tetrad gravatar image

Tetrad
7.2k 27 37 89

Cool, that works, thanks! The 3D text was more blurry than a regular GUIText though, so I might go for the multiple-camera answer instead if I'm not able to fix the more blurry text.

Jun 07 '10 at 11:52 PM TMK

Another solution would be to import a higher-res font (in the import settings change the font size) if that's what's causing your blurryness.

Also please be sure to mark the question as "answered".

Jun 07 '10 at 11:58 PM Tetrad

Thanks, I tried that, but it still wasn't as clear as 100% GUIText or GUI.Label... :(

Jun 08 '10 at 02:17 PM TMK
(comments are locked)
10|3000 characters needed characters left

Instead of GUIText or GUI.Label, use the TextMesh component (GameObject->Create->3d Text). That gives you a text mesh, which you can freely place in your 3d world.

more ▼

answered Jun 07 '10 at 10:51 PM

jonas echterhoff gravatar image

jonas echterhoff ♦♦
9.8k 7 23 104

(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:

x638
x313
x99

asked: Jun 07 '10 at 04:01 PM

Seen: 3545 times

Last Updated: Jan 05 '12 at 07:28 PM