Home | Trees | Index | Help |
---|
Package pygsear :: Module Drawable :: Class Drawable |
|
object
--+ |Sprite
--+ | Drawable
Image
,
Shape
,
AnimatedImage
,
MultiImage
,
Multi
,
String
,
Stationary
,
Layer
,
SpriteButton
,
Score
Method Summary | |
---|---|
Initialize Drawable sprite. | |
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 )
| |
alive() -> bool ask the life of a sprite (inherited from Sprite )
| |
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 | |
Erase sprite to background | |
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 | |
Blit image to layer | |
return a copy of the sprite's position | |
return size of sprite's rect. | |
groups() -> list list used sprite containers (inherited from Sprite )
| |
kill() end life of sprite, remove from all groups (inherited from Sprite )
| |
set position to next position on path | |
Move sprite. | |
return True if image is on the screen or layer. | |
stop moving along Path | |
remove(group) remove a sprite from container (inherited from Sprite )
| |
remove_internal(self,
group)
(inherited from Sprite )
| |
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 | |
update(self,
*args)
(inherited from Sprite )
|
Method Details |
---|
__init__(self,
w=None)
Initialize Drawable sprite.
|
__new__(S, ...)
|
can_see(self, target, blocking_rects_list)Performs a los (line of sight) check from the center of the source to the center of the target. Adapted from the Pygame Code Repository (PCR). Makes the following assumption:
|
center(self, x=None, y=None, dx=None, dy=None)Align the Drawable in its layer If no parameters are included, the sprite will be moved to the center of its screen layer, or use the parameters to adjust where exactly the sprite should be placed.
|
clear(self, surface=None)Erase sprite to background
|
collide(self, other)return True if this sprite and other sprite overlap. Uses the.crect attribute of each sprite to check for a
collision (overlap).
|
collidelist(self, lothers)return True if this sprite and any in list of others collide. The True value is the other sprite. Note that more than one sprite in the list may be colliding with the sprite, but only one is returned.
|
collidelistall(self, lothers)return True if this sprite and any in list of others collide. The True value is the list of colliding sprites, or if there is no collision, an empty sequence.
|
direction(self, point)return the direction from the sprite to a point
|
distance(self, point)return the distance from the sprite to a point
|
draw(self, surface=None)Blit image to layer
|
get_position(self)return a copy of the sprite's position |
get_size(self)return size of sprite's rect.
|
move(self)set position to next position on path |
nudge(self, dx=0, dy=0)Move sprite.
|
onscreen(self, slack=None, **kw)return True if image is on the screen or layer. Ifslack is None, and keyword args are included for
particular edges (ie top or right ) checks
only the edges passed by keyword.
|
pause(self)stop moving along Path |
runPath(self, frames=0)call move() continuously
|
set_crect(self, crect=None)set the collisionpygame.Rect used for collision
checking.
|
set_path(self, path)set which path to follow path: Instance ofPath.Path .
|
set_position(self, location, *args)Move sprite to location. set_position can be called as either Drawable._set_position .
|
set_positionRandom(self, slack=0)Move sprite to a random location on screen
|
set_size(self, size)Set size of sprite's rect.
|
solid(self, other, move_both=0)move sprite so that it does not overlap with other sprite
|
uclear(self, surface=None)clear sprite and update display
|
udraw(self, surface=None)Draw image and update display. This function is almost exclusively for use in an interactive session, since it updates the screen immediately after drawing the sprite instead of waiting and updating after all sprites have been drawn.
|
unpause(self)start moving along Path |
Home | Trees | Index | Help |
---|
Generated by Epydoc 1.1 on Sun Nov 30 19:33:10 2003 | http://epydoc.sf.net |