[Asset] Primitive UI - Draw shapes and lines in the new UI

Asset Store | Web Demo | Manual | Preview Images

Hi everyone,

First off, apologies if these kind of posts are not allowed or appreciated here; I couldn’t really find any forum rules or stickies regarding this.

That said, my first ever Asset Store submission just got accepted and since I’ve seen the topic of drawing primitives and complex shapes come up a couple of times already on this forum, I’d like to share it here as well.

Condensed ales talk:
Primitive UI lets you draw both simple primitives and more complex shapes and lines onto a component called PrimitiveCanvas. The way it works is reminiscent of the HTML5 canvas and is a great way to get arbitrary shapes on the screen without needing custom textures or masks.

It comes with out-of-the-box support for the following shape types:

  • Squares and Rectangles
  • Circles and Ellipses
  • Regular and Irregular Solids
  • Lines and Paths

In addition, you can pass in a series of polygon points for the UI to fill in automatically, as well as a series of raw VBO points for Unity 4.6-5.1 or mesh vertices and triangle indices for Unity 5.2.

Sample uses may include graphs, animated 2D shapes, dynamically drawn content or placeholder/ debug art.

Small warning:
The new Unity 5.2.1p1 patch release introduced a new change in the UI drawing API. Primitive UI still works as expected, but will throw an obsoletion warning on compilation. Since another change in this API is expected for the p3 patch release, and as patch releases are not officially supported as production-ready by Unity, I will not be further supporting patch releases p1 and p2 either, unless an asset-breaking bug is found.

Besides the obvious of checking out the asset, I would also very much appreciate any and all feedback you may have for me. I’d like to produce more Asset Store content in the future and would love to know what I could improve on.

Thanks!
-Patrick

1 Like

Great stuff @Senshi Awesome work!

1 Like

Thanks Simon!

1 Like

Hi Senshi,
Purchased the asset, works as expected.
Nice, simple and clean.

1 Like

Awesome, glad to hear that!

Whau I will have to check that you! I ve been missing somethign like this for one of our projects.

1 Like

I’m enjoying the asset @Senshi , would be great if I could use Primitive UI to draw text as well

Thank you! I’m afraid text is a whole beast of its own and I don’t feel there would be very many benefits to it. There are some great text solutions out there already though! =)

Hi Patrick, does this asset support drawing shapes on a world space canvas, or is it screen space only? I’m hoping to be able to draw shapes on a 3d scene.

I’ve never tried it, but I don’t see why not! In the end it’s just another Graphic inheriting from UI.MaskableGraphic. =)