Home | Trees | Index | Help |
---|
Package pygsear :: Module Drawable :: Class EuclidTurtle |
|
object
--+ |Sprite
--+ |Drawable
--+ |MultiImage
--+ |RotatedImage
--+ |Turtle
--+ | EuclidTurtle
Turtle with altered co-ordinate system.
Instead of (0, 0) being the upper left corner of the screen, the origin is the center of the screen. The EuclidTurtle also uses a different scale: each unit is by default 30 pixels.Method Summary | |
---|---|
__init__(self,
w,
position,
deg,
color,
filename,
colorkey,
convert)
| |
Quick drawing circle, centered on current position. | |
Quick drawing circle. | |
Quick drawing routine for rectangles. | |
Quick drawing routine for squares. | |
Draw the cartesian (x, y) coordinate system. | |
Scale a distance to a real screen distance. | |
Convert to real screen coordinates. | |
Scale a distance from a real screen distance. | |
Convert from real screen coordinates. | |
Set up the coordinate system. | |
Move the turtle forward a distance | |
Draw a line which includes these 2 points. | |
Draw a line through a point with a slope. | |
Draw a line segment between 2 points. | |
Move turtle to position, drawing a line | |
Move turtle to position, without drawing a line | |
Quick drawing routine for rectangles. | |
Clear the screen to LBLUE, and return Penguin to home | |
Quick drawing square. | |
Briefly show the current position of the turtle. | |
Inherited from Turtle | |
Move the turtle backward distance. | |
Start a new layer for drawing. | |
Start saving points for filling a polygon later | |
Flash the turtle on and off. | |
erase sprite image to background, returning affected rect | |
Clear the screen to background color. | |
Copy drawing layer to base window. | |
Fill the polygon of saved points | |
draw image, returning affected rect | |
return current turtle direction. | |
Resize the window (larger) | |
Set the penguin icon invisible | |
Move back to the home position | |
Turn left (counter-clockwise) a number of degrees | |
Change the pen color by given amounts. | |
Put pen down, ready to draw | |
Pull pen up. | |
Update the display. | |
Turn right (clockwise) a number of degrees | |
Throw out drawing layer. | |
Throw out list of saved points | |
Save background (the picture) as filename | |
Set the background color | |
Set the color for drawing. | |
Set default font size for write and where | |
Set the Penguin's home position | |
Set the penguin icon visible | |
Set line width for drawing. | |
Set the penguin icon visible | |
Resize the window (smaller) | |
Set turtle's direction to deg (degrees). | |
Update the display | |
Read pygame events until mouse click or any key press. | |
Draw text from current position, and at current angle. | |
Inherited from RotatedImage | |
Switch images for the sprite | |
return angle of rotation | |
set position to next position on path | |
rotate to the left by radians | |
set rotation rate to +2 | |
set rotation rate to -2 | |
set rotation rate to 0 | |
turn as quickly as possible towards a point | |
flip to the image for the current direction | |
Change which image is being shown. | |
set angle of rotation | |
set rate of rotation in radians / second | |
Inherited from MultiImage | |
add image to list of available images | |
remove image by name | |
Change the size of sprite's image, and rect. | |
Inherited from Drawable | |
bool |
Performs a los (line of sight) check from the center of the source to the center of the target. |
Align the Drawable in its layer | |
bool
|
return True if this sprite and other sprite overlap. |
Drawable or False
|
return True if this sprite and any in list of others collide. |
List
|
return True if this sprite and any in list of others collide. |
return the direction from the sprite to a point | |
return the distance from the sprite to a point | |
return a copy of the sprite's position | |
return size of sprite's rect. | |
Move sprite. | |
return True if image is on the screen or layer. | |
stop moving along Path | |
call move() continuously | |
set the collision pygame.Rect used for collision
checking. | |
set which path to follow | |
Move sprite to location. | |
Move sprite to a random location on screen | |
Set size of sprite's rect. | |
move sprite so that it does not overlap with other sprite | |
clear sprite and update display | |
Draw image and update display. | |
start moving along Path | |
Inherited from Sprite | |
| |
add(group or list of of groups, ...) add a sprite to container | |
| |
alive() -> bool check to see if the sprite is in any groups | |
groups() -> list of groups list used sprite containers | |
kill() remove this sprite from all groups | |
remove(group or list of groups, ...) remove a sprite from container | |
| |
Inherited from object | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
x.__hash__() <==> hash(x) | |
helper for pickle | |
helper for pickle | |
x.__setattr__('name', value) <==> x.name = value | |
x.__str__() <==> str(x) | |
Inherited from type | |
T.__new__(S, ...) -> a new object with type S, a subtype of T |
Class Variable Summary | |
---|---|
Inherited from Turtle | |
tuple |
BGCOLOR = (0, 0, 0)
|
tuple |
COLOR = (255, 255, 255)
|
Inherited from MultiImage | |
NoneType |
filenames = None |
Method Details |
---|
cCircle(self, radius, color=None, width=None)Quick drawing circle, centered on current position. Does not move the turtle (ie, the turtle will be returned to its present location before returning) "Quick drawing" means that this function draws the circle by callingpygame.draw.circle and not by simulating the
drawing of a circle with a number of line segments and turns, which
would be much slower.
|
circle(self, radius, clockwise=1, color=None, width=None)Quick drawing circle. Starting from current position and rotation. "Quick drawing" means that this function draws the circle by callingpygame.draw.circle and not by simulating the
drawing of a circle with a number of line segments and turns, which
would be much slower.
|
cRectangle(self, side_length=20, side_width=10, width=None, color=None, bgColor=(0, 51, 0, 0))Quick drawing routine for rectangles. Rectangle is centered on current position.
|
cSquare(self, side_length=2, width=None, color=None, bgColor=(0, 51, 0, 0))Quick drawing routine for squares. Square is centered on current position.
|
drawEuclidCoords(self)Draw the cartesian (x, y) coordinate system. |
euclid_scale(self, dist)Scale a distance to a real screen distance. |
euclid_translate(self, position)Convert to real screen coordinates. |
euclid_unscale(self, dist)Scale a distance from a real screen distance. |
euclid_untranslate(self, position)Convert from real screen coordinates. |
euclidean(self, drawCoords=1)Set up the coordinate system. |
forward(self, dist)Move the turtle forward a distance
|
line(self, p1, p2)Draw a line which includes these 2 points. Unlike
|
line_point_slope(self, p, m)Draw a line through a point with a slope. This function ignores the state of the pen.
|
lineSegment(self, p1, p2)Draw a line segment between 2 points. This function ignores the state of the pen.
|
lineTo(self, position)Move turtle to position, drawing a line Note that this ignores the state of the pen (up or down) and always draws a line in the current pen color.
|
moveTo(self, position)Move turtle to position, without drawing a line
|
rectangle(self, side_length=20, side_width=10, clockwise=1, width=None, color=None, bgColor=(0, 51, 0, 0))Quick drawing routine for rectangles.
|
reset(self)Clear the screen to LBLUE, and return Penguin to home also reset pen color to WHITE, and turn back to 90 deg (standing straight up)
|
square(self, side_length=20, clockwise=1, width=None, color=None, bgColor=(0, 51, 0, 0))Quick drawing square.
|
where(self)Briefly show the current position of the turtle.
|
Home | Trees | Index | Help |
---|
Generated by Epydoc 2.0 on Sat Dec 9 14:11:20 2006 | http://epydoc.sf.net |