UniCanvas (Asset Store)
Supported OS: Windows, Mac, Linux
You can draw textures dynamically with HTML Canvas API.
UniCanvas has instruction sets very similar to Canvas API that implemented with Cairo graphics library.
You can also use Cairo API instead of Canvas API.
UniCanvas is linked to following native libraries.
Native library files are contained in "Assets/UniCanvas/Plugins/Windows" folder.
Native library files are not contained. Please install them using package manager.
$ brew install cairo
Native library files are not contained. Please install them using package manager.
Ubuntu or Debian-based Linux:
$ sudo apt install libcairo2
Other platforms are not supported.
However you can use UniCanvas using your own dynamic link library files.
Please make sure your libraries are built with "cdecl" calling convention.
Each UniCanvas.dll in "Assets/UniCanvas/Plugins" folder are referencing different native library files.
Rename your library file to one of above name and set up UniCanvas.dll within "Import Settings" for your platform on Unity.
Only supported "2d" canvas context.
UniCanvas was implemented with reference to following documents.
If an error occurs when calling ApplyTo() method, set your Texture2D object as follows:
You can draw SVG images using UniCanvas.Rsvg.
UniCanvas.Rsvg uses librsvg library internally.
It is licensed under GPL, please be careful it's usage.
You can use more JavaScript code compatibilities.
Please add following line to your MonoBehaviour based .cs file:
using UniCanvas.Web;
Rewrite your class to inherit from WebMonoBehaviour instead of MonoBehaviour.
public class MyClass : WebMonoBehaviour
Then you can use more web compatible functions.
For example:
You can copy and paste from more types of JavaScript code by using above functions.