Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by TowerOfBricks · Jan 23, 2011 at 01:17 PM · editoreditor-scriptingsceneviewhandles

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

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image yoyo · Sep 07, 2011 at 10:39 PM 0
Share

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 ... ;-)

1 Reply

· Add your reply
  • Sort: 
avatar image
0

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

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image yoyo · Sep 08, 2011 at 01:10 AM 0
Share

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

avatar image vxssmatty · Sep 08, 2011 at 02:28 AM 0
Share

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

Your answer

Hint: You can notify a user about this post by typing @username

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

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

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


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges