Package pygsear :: Module Drawable :: Class PSprite
[show private | hide private]
[frames | no frames]

Class PSprite

object --+    
         |    
    Sprite --+
             |
            PSprite


New pygsear sprite class. Not used by any other code yet.
Method Summary
  __init__(self, window)
  clear(self)
Erase sprite to background
  direction(self, rect)
return the direction from the sprite to a point
  distance(self, rect)
return the distance from the sprite to a point
  draw(self)
Blit image to layer
  move(self)
  onscreen(self, slack, **kw)
return True if image is on the screen or layer.
  pause(self)
  udraw(self)
Draw image and update display.
  unpause(self)
  _get_ax(self)
  _get_ay(self)
  _get_bottom(self)
  _get_center(self)
  _get_centerx(self)
  _get_centery(self)
  _get_image(self)
  _get_left(self)
  _get_position(self)
  _get_right(self)
  _get_size(self)
  _get_top(self)
  _get_topleft(self)
  _get_vx(self)
  _get_vy(self)
  _set_ax(self, ax)
  _set_ay(self, ay)
  _set_bottom(self, bottom)
  _set_center(self, center)
  _set_centerx(self, centerx)
  _set_centery(self, centery)
  _set_image(self, image)
  _set_left(self, left)
  _set_position(self, position)
  _set_right(self, right)
  _set_size(self, size)
  _set_top(self, top)
  _set_topleft(self, topleft)
  _set_vx(self, vx)
  _set_vy(self, vy)
    Inherited from Sprite
  __repr__(self)
  add(self, *groups)
add(group or list of of groups, ...) add a sprite to container
  add_internal(self, group)
  alive(self)
alive() -> bool check to see if the sprite is in any groups
  groups(self)
groups() -> list of groups list used sprite containers
  kill(self)
kill() remove this sprite from all groups
  remove(self, *groups)
remove(group or list of groups, ...) remove a sprite from container
  remove_internal(self, group)
  update(self, *args)
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)
    Inherited from type
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T

Property Summary
  ax
  ay
  bottom
  center
  centerx
  centery
  image
  left
  position
  right
  size
  top
  topleft
  vx
  vy

Method Details

clear(self)

Erase sprite to background
Returns:
Affected pygame.Rect which can be passed to pygame.display.update.

direction(self, rect)

return the direction from the sprite to a point
Parameters:
rect - Rect to find the direction to.

distance(self, rect)

return the distance from the sprite to a point
Parameters:
rect - Rect to find the distance to.

draw(self)

Blit image to layer
Returns:
Affected pygame.Rect which can be passed to pygame.display.update.

onscreen(self, slack=None, **kw)

return True if image is on the screen or layer.

If slack is None, and keyword args are included for particular edges (ie top or right) checks only the edges passed by keyword.
Parameters:
slack - Distance sprite can be off screen and still return True. Use a negative number to restrict the sprite to a smaller area.
Keyword Parameters:
left - Sprite can be this far from left edge.
right - Sprite can be this far from right edge.
top - Sprite can be this far from top edge.
bottom - Sprite can be this far from bottom edge.
clamp - Sprite will be moved completely onscreen.

udraw(self)

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.

Property Details

ax

Get Method:
_get_ax(self)
Set Method:
_set_ax(self, ax)

ay

Get Method:
_get_ay(self)
Set Method:
_set_ay(self, ay)

bottom

Get Method:
_get_bottom(self)
Set Method:
_set_bottom(self, bottom)

center

Get Method:
_get_center(self)
Set Method:
_set_center(self, center)

centerx

Get Method:
_get_centerx(self)
Set Method:
_set_centerx(self, centerx)

centery

Get Method:
_get_centery(self)
Set Method:
_set_centery(self, centery)

image

Get Method:
_get_image(self)
Set Method:
_set_image(self, image)

left

Get Method:
_get_left(self)
Set Method:
_set_left(self, left)

position

Get Method:
_get_position(self)
Set Method:
_set_position(self, position)

right

Get Method:
_get_right(self)
Set Method:
_set_right(self, right)

size

Get Method:
_get_size(self)
Set Method:
_set_size(self, size)

top

Get Method:
_get_top(self)
Set Method:
_set_top(self, top)

topleft

Get Method:
_get_topleft(self)
Set Method:
_set_topleft(self, topleft)

vx

Get Method:
_get_vx(self)
Set Method:
_set_vx(self, vx)

vy

Get Method:
_get_vy(self)
Set Method:
_set_vy(self, vy)

Generated by Epydoc 2.0 on Sat Dec 9 14:11:20 2006 http://epydoc.sf.net