-
Notifications
You must be signed in to change notification settings - Fork 5
Canvas plugin
meurigbeynon edited this page Feb 29, 2016
·
5 revisions
Since we can have multiple canvases (as set up via the Views menu), we need to be able to draw to different canvases. In order to draw to a specific canvas, such as view_2, we should introduce a new picture observable, and a corresponding display agent:
picture2 = [];
proc drawPicture2 : picture2 {
CanvasHTML5_DrawPicture("view_2","picture2");
};
In order to assign a name to the canvas other than view_?, you can use the createView function.
When you use multiple canvases in conjunction with mouse actions, you will find it useful to specify the canvas to which each mouse action applies. For this purpose, you can use the mouseView observable.