Search Unity

Draw Rectangles on a Canvas?

Discussion in 'UGUI & TextMesh Pro' started by cakefile, Aug 8, 2019.

  1. cakefile

    cakefile

    Joined:
    Dec 12, 2018
    Posts:
    3
    So far I've used OnGui() to draw Rectangles on the screen. Unfortunately, they aren't visible in VR, so I have to render them on a 3D Object.
    How can I draw Rectangles on a Canvas instead? Is there a similar function to GUI.Box()? Or does anyone know if I can render my GUI content on a texture and paste it on a canvas?
     
  2. SimonDarksideJ

    SimonDarksideJ

    Joined:
    Jul 3, 2012
    Posts:
    1,689
    Check out the Unity UI Extensions project, tons of Primitives drawing controls there for either using primitives like square, circle, etc. And even a line drawer to draw whatever you like.
    http://bit.ly/unityuiextensions
     
    JBKacerovsky likes this.