x


Are there any way to show text over an object in Editor mode only?

I was wondering if there were any way to show text over an object(at the objects location) in Editor mode only, done programmatically?

more ▼

asked Apr 20 '11 at 04:40 PM

PaxNemesis gravatar image

PaxNemesis
235 9 11 21

A text gizmo, I'd love that. Please vote for it at http://feedback.unity3d.com

Apr 20 '11 at 05:03 PM DaveA

Indeed, that would've been exactly what I need.

Apr 20 '11 at 05:11 PM PaxNemesis
(comments are locked)
10|3000 characters needed characters left

3 answers: sort voted first

The solution I found to closest match this problem was in using the Handles.Label function. It seems to do the trick.

using UnityEditor;

public class EditorClassName : Editor
{
    void OnSceneGUI ()
    {
        var _target = (Type)target;
        Handles.Label(_target.transform.position, "lblText");
    }
}

http://unity3d.com/support/documentation/ScriptReference/Handles.Label.html

more ▼

answered Apr 21 '11 at 04:09 PM

PaxNemesis gravatar image

PaxNemesis
235 9 11 21

as an added Editor only encase the calls within #if UNITY_EDITOR defines

Jul 18 '12 at 05:52 PM MSylvia
(comments are locked)
10|3000 characters needed characters left

+1 This is the ovious efficient way to do it :)

-1 nevertheless, it's bugged. Labels always show up, even when they're behing camera. This leads to weird messy and bothering things drawn on screen

regards.

more ▼

answered Jun 27 '11 at 11:05 AM

pitibonom gravatar image

pitibonom
26 4

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

answered Jul 06 '11 at 03:27 PM

qaat gravatar image

qaat
31 1

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

x5085
x1675
x553

asked: Apr 20 '11 at 04:40 PM

Seen: 1763 times

Last Updated: Jul 18 '12 at 05:52 PM