Home

Awesome

Vector Shapes for Unity

VectorShapes is a simple and easy to use library for drawing vector shapes in Unity.

Created by Mario von Rickenbach

Features

Stroke features

Fill features

Compatibility

Works with unity 2019.3+

Installation

Install this package in the package manager: "+" -> "Add package from git URL":

https://github.com/anyuser/vectorshapes-unity.git

Getting started

VectorShapes can be used completely without coding. Shapes can be created by adding a Shape and ShapeRenderer component to a GameObject.

Create shape

Basic shapes can be created by clicking "GameObject/2D Object/XYZ Shape" in the Unity menu bar. Alternatively, a shape can be created by adding a Shape and a Shape Renderer component to a game object.

Shapes

Shape is a component that can be attached to GameObjects. It defines the properties of a shape and can be rendered by a ShapeRenderer. By default, shape data is directly saved in the object. Alternatively, the shape data can be a referenced from a Shape Asset.

Shape renderers

Shapes are either rendered by a ShapeRenderer attached to the GameObject, or by a ShapeRenderer in a parent object. If you want to render multiple shapes with the same materials, it's best to create only one renderer and attach Shapes to the transform hierarchy under that ShapeRenderer. If more than one parent object of a Shape has a ShapeRenderer, the closest activated one in the hierarchy is used to render the object.

Shape assets

Shape Asset is an asset which contains shape data, saved in the project as an asset. It can be referenced by a Shape comonent to reuse content.

Shape Properties

Optimizing performance

Performance considerations:

CPU mode

Known issues / limitations

Render order

Corners

Antialiasing

Variable stroke width & color

Stroke textures

Import & export