Media

CODE PAGE

Example Shape

ZIM has a bunch of built-in shapes:

These have dimensions, color, borderColor, borderThickness and dashed parameters as well as a few more depending on the shape.

There is also a generic Shape class where you can draw lines, curves and shapes and set strokes and fills. These are all found in Display module in the DOCS.

// Put this in the ZIM Editor at https://zimjs.com/editor

// SAMPLE SHAPE

// a Circle with radius of 90 pixels and color of red

const circle = new Circle(100, red);
circle.center();

// or preferably with chaining:

new Circle(150, orange).center();

// for chaining, we can put commands on new lines too:

new Circle(200, purple)
	.center()
	.drag(); // a draggable circle - note the ; is at the end

Making digital environments in which people cancreate, communicate and play