Before updating to Windows 10 you may need to return your Pro license. More information here

Using Handles.DrawAAPolyLine


I'm trying to use the function Handles.DrawAAPolyLine to draw a line in the scene view. However I can't seem to set the width of that line, it looks like it is 1 unit wide all the time. In the docs it points to HandleUtility.GetHandleSize to help adjusting the width, but I can't find where to use it.

The syntax is as follows:

static function DrawAAPolyLine (params points : Vector3[]) : void

static function DrawAAPolyLine (lineTex : Texture2D, params points : Vector3[]) : void

By using reflection I can see that Handles internally calls a function with a width parameter

private static function Internal_DrawAAPolyLine2 (Color color, Vector3[] points, Texture2D texture, float width) : void

But that function is private, so I can't use it.

Anyone got any suggestions?

Thanks in advance

more ▼

asked Jan 23, 2011 at 01:17 PM

avatar image

4.1k 52 72 81

I tried DrawAAPolyLine for the first time today. I can't get it to draw anything.

There are overloads that take a width parameter, but that doesn't seem to help.

Note that you could use reflection to get a MethodInfo for the private method, then use MethodInfo.Invoke to call it. Dirty, but it might work. I'm not that desperate ... ;-)

Sep 07, 2011 at 10:39 PM yoyo
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

reading this page:


You have to initialize the drawing system before you can actually use it. Similar to the runtime class GL.

Research the main class 'handles' and i hope that gets you going :D

EDIT: Realized this question is old, but hopefully someone can benefit from a pointer in the right direction


more ▼

answered Sep 07, 2011 at 11:23 PM

avatar image

121 11 14 12

Handles.DrawPolyLine works fine, Handles.DrawAAPolyLine doesn't ... looks like a Unity bug to me. :-p

Sep 08, 2011 at 01:10 AM yoyo

I havn't tested myself, so i couldn't confirm. So touche, that sucks =P bug needs filing! haha

Sep 08, 2011 at 02:28 AM vxssmatty
(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



Answers and Comments



asked: Jan 23, 2011 at 01:17 PM

Seen: 1693 times

Last Updated: Sep 08, 2011 at 03:51 AM