This is a cheat-sheet page for the cs1graphics module, detailing the most important types of objects (an 'object' in Computer Science is just a generic term for a value in a program that can be manipulated using attached functions).

For each object, it lists how to create it and what you can do with it.

cs1graphics Objects

Canvas

A canvas is a special object that represents the drawing window. You will only create one Canvas in your program.

Drawable

Any kind of thing you can draw (everything on this list counts as a Drawable).

Layer

Contains other objects so that they can be manipulated as a group.

Text

Draws words on the canvas.

Shape

Any kind of shape (applies to the rest of the objects listed here). A Shape is a kind of Drawable, so you can do things like rotate it or use getReferencePoint on it.

Path

A series of lines connecting specific points.

Circle

A circle with a specific radius. A Circle is a Shape and also a Drawable, so you can do things with it like scale or setFillColor.

Ellipse

An ellipse with a specific width and height. An Ellipse is a Shape and also a Drawable, so you can do things with it like scale or setFillColor.

Rectangle

A rectangle with a width, height, and center point. A Rectangle is a Shape and also a Drawable, so you can do things with it like scale or setFillColor.

Polygon

A polygon has some points that define an outside and a filled in inside. A Polygon is a Shape and also a Drawable, so you can do things with it like scale or setFillColor.

Image

An Image object draws an image that's stored in a file. The .gif format should always be supported, other images might or might not work. .gif animations will only show the first frame of the animation.