#
Canvas
Represents a surface to draw pictures into.
There are higher level behaviours that you can use directly in the Unity editor. Use this class if you need direct control of the lifecycle of the Canvas and its backing Texture.
#
Examples
Make a Canvas and immediately clear it to blue.
var canvas = new Vellum.Canvas(width, height);
var picture = canvas.makePicture();
picture.clear(Color.blue);
picture.submit(this);
Make a software Canvas.
var canvas = new Vellum.Canvas(width, height, true);
#
Constructors
#
Canvas(int width, int height, bool forceSoftware = False)
Creates a canvas of the given width and height.
#
Properties
#
Texture texture
The backing texture the canvas will draw to.
The concrete type depends on the active rendering backend.
- RenderTexture when Canvas renders with the GPU.
- Texture2D when Canvas renders with the CPU.
#
Methods
#
Picture makePicture()
Create a Picture object which is used to issue draw commands.