x


GUIStyle.DrawWithTextSelection : How to use ?

I'm trying to use this function : GUIStyle.DrawWithTextSelection

void OnGUI ()
    {
       text = new GUIContent ("I want select this part by code");
       if (Event.current.type == EventType.Repaint) {
         myLabelID = GUIUtility.GetControlID (text, FocusType.Keyboard, rect);
         GUI.skin.GetStyle ("MyLabel").DrawWithTextSelection (rect, text, myLabelID, 5, 10);
       }
    }

It draw my text, but with no selection. What i missed ? :(

more ▼

asked Jul 19 '11 at 02:38 PM

KevS gravatar image

KevS
38 4 4 7

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

0 answers: sort voted first
Be the first one to answer this question
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:

x3689
x553
x130

asked: Jul 19 '11 at 02:38 PM

Seen: 618 times

Last Updated: Jul 19 '11 at 08:28 PM