cs1lib User’s Guide

This page describes the functions in cs1lib.py that you can call. Here’s a link to the qt version of cs1lib, which requires that you have PySide installed. You can test cs1lib.py by running it; if you would like to test whether it draws images, download star.png and put it in the same directory as cs1lib.py.

This guide is organized according to what the functions do.

Test window

Here is a small editor where you can try out cs1lib functions using the browser version of the library. A few functions, including those that pertain to loading and drawing of images and setting fonts, are not included in the browser version.

Functions pertaining to the entire graphics window

Functions that draw into the graphics window

Functions that change behavior of functions that draw

These functions, on their own, do not cause anything to change in the graphics window. They affect how future calls of functions that draw into the graphics window will behave. The most recent call of these functions will be in effect whenever a drawing function is called. For example, if disable_fill() was called more recently than enable_fill() and draw_rectangle(0, 0, 100, 200) is called, then the rectangle will be drawn unfilled.

Functions that return information about strings