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

Class RotatedImage

object --+            
         |            
    Sprite --+        
             |        
      Drawable --+    
                 |    
        MultiImage --+
                     |
                    RotatedImage

Known Subclasses:
MultiRotated, Turtle

Sprite with auto-generated rotated images
Method Summary
  __init__(self, w, filename, steps, image, colorkey, convert, cx, cy)
Initialize RotatedImage
  flip(self, key)
Switch images for the sprite
  get_rotation(self)
return angle of rotation
  move(self)
set position to next position on path
  rotate(self, rad)
rotate to the left by radians
  rotate_left(self)
set rotation rate to +2
  rotate_right(self)
set rotation rate to -2
  rotate_stop(self)
set rotation rate to 0
  rotate_towards(self, point)
turn as quickly as possible towards a point
  set_closest(self)
flip to the image for the current direction
  set_image(self, key)
Change which image is being shown.
  set_rotation(self, direction)
set angle of rotation
  set_rotationRate(self, rate)
set rate of rotation in radians / second
    Inherited from MultiImage
  addImage(self, filename, image, colorkey, convert)
add image to list of available images
  removeImage(self, key)
remove image by name
  stretch(self, dx, dy, size, keepAspectRatio)
Change the size of sprite's image, and rect.
    Inherited from Drawable
bool 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.
  center(self, x, y, dx, dy)
Align the Drawable in its layer
  clear(self, surface)
Erase sprite to background
bool collide(self, other)
return True if this sprite and other sprite overlap.
Drawable or False collidelist(self, lothers)
return True if this sprite and any in list of others collide.
List collidelistall(self, lothers)
return True if this sprite and any in list of others collide.
  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)
Blit image to layer
  get_position(self)
return a copy of the sprite's position
  get_size(self)
return size of sprite's rect.
  nudge(self, dx, dy)
Move sprite.
  onscreen(self, slack, **kw)
return True if image is on the screen or layer.
  pause(self)
stop moving along Path
  runPath(self, frames)
call move() continuously
  set_crect(self, crect)
set the collision pygame.Rect used for collision checking.
  set_path(self, path)
set which path to follow
  set_position(self, location, *args)
Move sprite to location.
  set_positionRandom(self, slack)
Move sprite to a random location on screen
  set_size(self, size)
Set size of sprite's rect.
  solid(self, other, move_both)
move sprite so that it does not overlap with other sprite
  uclear(self, surface)
clear sprite and update display
  udraw(self, surface)
Draw image and update display.
  unpause(self)
start moving along Path
    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

Class Variable Summary
    Inherited from MultiImage
NoneType filenames = None                                                                  

Method Details

__init__(self, w=None, filename=None, steps=4, image=None, colorkey=(0, 51, 0, 0), convert=1, cx=None, cy=None)
(Constructor)

Initialize RotatedImage
Parameters:
w - Screen.Layer to draw in.
filename - name of file from which to load image
steps - number of separate rotated images to create Note -- does not work with > 360 steps
image - image to use, instead of loading from file
colorkey - set this colorkey on all rotated images
convert - boolean, 1 = convert() every rotated image
cx - x-coordinate of center of rotation relative to the upper left corner of the image.
cy - y-coordinate of center of rotation relative to the upper left corner of the image.
Overrides:
pygsear.Drawable.MultiImage.__init__

flip(self, key=None)

Switch images for the sprite
Overrides:
pygsear.Drawable.MultiImage.flip

get_rotation(self)

return angle of rotation

move(self)

set position to next position on path
Overrides:
pygsear.Drawable.Drawable.move (inherited documentation)

rotate(self, rad=None)

rotate to the left by radians

rotate_left(self)

set rotation rate to +2

rotate_right(self)

set rotation rate to -2

rotate_stop(self)

set rotation rate to 0

rotate_towards(self, point)

turn as quickly as possible towards a point

set_closest(self)

flip to the image for the current direction

set_image(self, key)

Change which image is being shown.
Parameters:
key - dict key referencing the image to use. The keys are the rotation of the images.

set_rotation(self, direction=None)

set angle of rotation
Parameters:
direction - angle to set 0 is pointing to the right positive is counter-clockwise

set_rotationRate(self, rate)

set rate of rotation in radians / second

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