Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Handles (specifically lines) without the IMGUIContainer?

Discussion in 'UI Toolkit' started by MartinIsla, Dec 19, 2018.

  1. MartinIsla

    MartinIsla

    Joined:
    Sep 18, 2013
    Posts:
    104
    Good morning!

    I wanted to know if there was a way to use Handles.DrawLine (or something similar) without using an IMGUIContainer.

    Thanks!
     
    joshcamas likes this.
  2. joshcamas

    joshcamas

    Joined:
    Jun 16, 2017
    Posts:
    1,279
    This is something really important in my opinion! :))
     
  3. uDamian

    uDamian

    Unity Technologies

    Joined:
    Dec 11, 2017
    Posts:
    1,231
    We don't yet have Handles support native to UIElements. However, you can draw arbitrary meshes using the ImmediateModeElement and its DoRepaint() override. This is using raw GL calls. It's how GraphView implements its node edges, for example.