Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Feature Request Simple line drawing on to of the UI

Discussion in 'UI Toolkit' started by pKallv, Dec 28, 2018.

  1. pKallv

    pKallv

    Joined:
    Mar 2, 2014
    Posts:
    828
    Is this something that is considered, if not: It is needed.
     
  2. MartinIsla

    MartinIsla

    Joined:
    Sep 18, 2013
    Posts:
    72
    For now, I use an IMGUI container and the good ol' Handles.DrawLine, Handles.DrawBezier, Handles.DrawAALineor whatever you want.
    Not perfect (I'd love to never see IMGUI again), but it works!
     
    pKallv likes this.
  3. JoshuaMcKenzie

    JoshuaMcKenzie

    Joined:
    Jun 20, 2015
    Posts:
    833
    You can also look at the code for the EdgeControl in the GraphView repo for an example of how Edges (e.g. lines) are rendered on a Graphview, without relying on IMGUI.
     
  4. jonathanma_unity

    jonathanma_unity

    Unity Technologies

    Joined:
    Jan 7, 2019
    Posts:
    101
    Hi, currently the only way to do custom rendering in UIElements is by inheriting from ImmediateModeElement and overriding the ImmediateRepaint function.

    From there you have access to Handles, Graphics and so on.
     
unityunity