- Home /
Question by
WallHackJack · Aug 04, 2017 at 10:55 AM ·
guicanvasguitexturehtml5shapes
Unity GUI: Any features similar to Html5 Canvas or Turtle graphics?
Hey! I'm looking for the quickest way to implement a system like HTML5 Canvas's functionality into Unity.
I'd like to draw custom shapes to an -Image-, which is attached to a game-object on a -Canvas- . The solution has to support drawing custom shapes, filled or stroked, with nice line-styles (capped, round, flat), and line-thickness. Outlines/shadows and scene-graphs are a bonus.
The ideal style I'd like to use in order to create shapes would be this:
image.context.fillRect(0, 0, image.width, image.height);
image.context.strokeStyle = new Color(1,1,1);
image.context.beginPath();
image.context.moveTo(x, y);
image.context.arc(x, y, r, 0, 90, true);
image.context.stroke();
If Unity supports this functionality or something similar in 2017, I'd love to know how to create custom shapes with outlines in the canvas. Otherwise, package/extension suggestions would be much appreciated.
Comment