CS110 Introduction to Computing
Spring 2009
Lab Assignment#6
Due on Thursday, April 9, 2009
Assignment:
Problem: Using the graphics facilities of Chapter 8&9 of your text, write a Python program that creates a graphic design. The design should be at least 800x600 pixels (height x width) in dimension. For the design of your graphic you may choose one of the following themes:
Your graphic should include a caption that specifies the theme. You may use any of the graphics facilities described in Chapters 8&9 of your text, including images (though using just an image in the graphic will not suffice). You may also use an animation if you'd like. Your program should 'create' the design using a computation or a set of transformations.
What you will need to do
Notes:
Add the following line to all your Python programs:
# File: <place name of your program file here> # Date: <date created> # Created by: <your name> # Assignment: <place assignment number here>
Added on April 6:
Here are some useful text functions you can use. Example:
t = Text(Point(200, 200), "Hello")
t.setFace("times roman")
t.setStyle("bold italic")
t.setSize(36)
...etc...
Text Methods
Text(anchorPoint, string)
Constructs a text object that displays the given string centered at anchorPoint. The text is displayed horizontally.
setText(string)
Sets the text of the object to string.
getText()
Returns the current string.
getAnchor()
Returns a clone of the anchor point.
setFace(family)
Changes the font face to the given family. Possible values are: 'helvetica', 'courier', 'times roman', and 'arial'.
setSize(point)
Changes the font size to the given point size. Sizes from 5 to 36 points are legal.
setStyle(style)
Changes font to the given style. Possible values are 'normal', 'bold', 'italic', and 'bold italic'.
setTextColor(color)
Sets the color of the text to color. Note: setFill has the same effect.