Simple Shapes

Within Bonsai’s path module are a selection of shape classes. Note that these are globally exposed and inherit from the Path class.

var myShape = new Rect(10, 10, 100, 100);

myShape.fill('yellow');
myShape.stroke('#f00', 2);
myShape.addTo(stage);

For a more detailed overview and more details about the path module see the Paths Overview and the Path Module Documentation.