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)
| |
a new object with type S, a subtype of T |
|
__repr__(self)
(inherited from Sprite )
| |
add(group) add a sprite to container (inherited from Sprite )
| |
add_internal(self,
group)
(inherited from Sprite )
| |
add image to list of available images (inherited from MultiImage )
| |
alive() -> bool ask the life of a sprite (inherited from Sprite )
| |
Move the turtle backward distance. (inherited from Turtle )
| |
Start a new layer for drawing. (inherited from Turtle )
| |
Start saving points for filling a polygon later (inherited from Turtle )
| |
Flash the turtle on and off. (inherited from Turtle )
| |
bool |
Performs a los (line of sight) check from the center of the source to the center of the target. (inherited from Drawable )
|
Quick drawing circle, centered on current position. | |
Align the Drawable in its layer (inherited from Drawable )
| |
Quick drawing circle. | |
erase sprite image to background, returning affected rect (inherited from Turtle )
| |
Clear the screen to background color. (inherited from Turtle )
| |
bool
|
return True if this sprite and other sprite overlap. (inherited from Drawable )
|
Drawable or False
|
return True if this sprite and any in list of others collide. (inherited from Drawable )
|
List
|
return True if this sprite and any in list of others collide. (inherited from Drawable )
|
Copy drawing layer to base window. (inherited from Turtle )
| |
Fill the polygon of saved points (inherited from Turtle )
| |
Quick drawing routine for rectangles. | |
Quick drawing routine for squares. | |
return the direction from the sprite to a point (inherited from Drawable )
| |
return the distance from the sprite to a point (inherited from Drawable )
| |
draw image, returning affected rect (inherited from Turtle )
| |
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. | |
Switch images for the sprite (inherited from RotatedImage )
| |
Move the turtle forward a distance | |
return current turtle direction. (inherited from Turtle )
| |
return a copy of the sprite's position (inherited from Drawable )
| |
return angle of rotation (inherited from RotatedImage )
| |
return size of sprite's rect. (inherited from Drawable )
| |
groups() -> list list used sprite containers (inherited from Sprite )
| |
Resize the window (larger) (inherited from Turtle )
| |
Set the penguin icon invisible (inherited from Turtle )
| |
Move back to the home position (inherited from Turtle )
| |
kill() end life of sprite, remove from all groups (inherited from Sprite )
| |
Turn left (counter-clockwise) a number of degrees (inherited from Turtle )
| |
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 | |
set position to next position on path (inherited from RotatedImage )
| |
Move turtle to position, without drawing a line | |
Move sprite. (inherited from Drawable )
| |
Change the pen color by given amounts. (inherited from Turtle )
| |
return True if image is on the screen or layer. (inherited from Drawable )
| |
stop moving along Path (inherited from Drawable )
| |
Put pen down, ready to draw (inherited from Turtle )
| |
Pull pen up. (inherited from Turtle )
| |
Quick drawing routine for rectangles. | |
Update the display. (inherited from Turtle )
| |
remove(group) remove a sprite from container (inherited from Sprite )
| |
remove_internal(self,
group)
(inherited from Sprite )
| |
remove image by name (inherited from MultiImage )
| |
Clear the screen to LBLUE, and return Penguin to home | |
Turn right (clockwise) a number of degrees (inherited from Turtle )
| |
Throw out drawing layer. (inherited from Turtle )
| |
Throw out list of saved points (inherited from Turtle )
| |
rotate to the left by radians (inherited from RotatedImage )
| |
set rotation rate to +2 (inherited from RotatedImage )
| |
set rotation rate to -2 (inherited from RotatedImage )
| |
set rotation rate to 0 (inherited from RotatedImage )
| |
turn as quickly as possible towards a point (inherited from RotatedImage )
| |
call move() continuously (inherited from Drawable )
| |
Save background (the picture) as filename (inherited from Turtle )
| |
Set the background color (inherited from Turtle )
| |
flip to the image for the current direction (inherited from RotatedImage )
| |
Set the color for drawing. (inherited from Turtle )
| |
set the collision pygame.Rect used for collision
checking. (inherited from Drawable )
| |
Set default font size for write and where (inherited from Turtle )
| |
Set the Penguin's home position (inherited from Turtle )
| |
Change which image is being shown. (inherited from RotatedImage )
| |
set which path to follow (inherited from Drawable )
| |
Move sprite to location. (inherited from Drawable )
| |
Move sprite to a random location on screen (inherited from Drawable )
| |
set angle of rotation (inherited from RotatedImage )
| |
set rate of rotation in radians / second (inherited from RotatedImage )
| |
Set size of sprite's rect. (inherited from Drawable )
| |
Set the penguin icon visible (inherited from Turtle )
| |
Set line width for drawing. (inherited from Turtle )
| |
Set the penguin icon visible (inherited from Turtle )
| |
Resize the window (smaller) (inherited from Turtle )
| |
move sprite so that it does not overlap with other sprite (inherited from Drawable )
| |
Quick drawing square. | |
Change the size of sprite's image, and rect. (inherited from MultiImage )
| |
Set turtle's direction to deg (degrees). (inherited from Turtle )
| |
clear sprite and update display (inherited from Drawable )
| |
Draw image and update display. (inherited from Drawable )
| |
start moving along Path (inherited from Drawable )
| |
Update the display (inherited from Turtle )
| |
Read pygame events until mouse click or any key press. (inherited from Turtle )
| |
Briefly show the current position of the turtle. | |
Draw text from current position, and at current angle. (inherited from Turtle )
|
Method Details |
---|
__new__(S, ...)
|
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 1.1 on Sun Jan 25 19:10:09 2004 | http://epydoc.sf.net |