- Home /
Using Handles.DrawAAPolyLine
Hi
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
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 $$anonymous$$ethodInfo for the private method, then use $$anonymous$$ethodInfo.Invoke to call it. Dirty, but it might work. I'm not that desperate ... ;-)
Answer by vxssmatty · Sep 07, 2011 at 11:23 PM
reading this page:
http://unity3d.com/support/documentation/ScriptReference/Handles.html
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
Matty
Handles.DrawPolyLine works fine, Handles.DrawAAPolyLine doesn't ... looks like a Unity bug to me. :-p
I havn't tested myself, so i couldn't confirm. So touche, that sucks =P bug needs filing! haha
Your answer
Follow this Question
Related Questions
Change the color/size of a position handle 0 Answers
How to create persistent handles in Editor Scene View? 1 Answer
Scene view cannot recognise movement of several objects in the editor until objects are selected 1 Answer
How do you hide a GameObject's handles? 1 Answer
Keep multiple custom handles visible in the Scene view 0 Answers