Package pype :: Module sprite :: Class Sprite
[frames] | no frames]

Class Sprite

source code

  object --+    
           |    
ScaledSprite --+
               |
              Sprite

Sprite object (wrapper for pygame surface class).

See ScaledSprite() class for info -- Sprite instances are just ScaledSprites that with no scaling (ie, physical and virtual sizes are the same).

Instance Methods
 
__init__(self, width=100, height=100, x=0, y=0, depth=0, fb=None, on=1, image=None, fname=None, name=None, icolor='black', ifill='yellow', centerorigin=0, rotation=0.0, contrast=1.0, scale=1.0)
Sprite Object -- pype's main tool for graphics generation.
source code

Inherited from ScaledSprite: X, XY, Y, __del__, __repr__, alpha_aperture, alpha_gradient, alpha_gradient2, asImage, asPhotoImage, blit, circle, circlefill, clear, clone, dim, displayim, fastblit, fill, hard_aperture, line, moveto, noise, off, on, rect, refresh, render, rmove, rotate, rotateCCW, rotateCW, save, save_alpha_pgm, save_ppm, scale, set_alpha, set_contrast, set_rotation, setdir, state, subimage, thresh, threshold, toggle

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

__init__(self, width=100, height=100, x=0, y=0, depth=0, fb=None, on=1, image=None, fname=None, name=None, icolor='black', ifill='yellow', centerorigin=0, rotation=0.0, contrast=1.0, scale=1.0)
(Constructor)

source code 
Sprite Object -- pype's main tool for graphics generation.
Parameters:
  • width, height - (int) sprite size in pixels
  • x, y - (int) sprite position in pixels
  • depth - (int; default 0) sprite stacking order for DisplayList (0 is on top)
  • fb - (FrameBuffer object) associated FrameBuffer object
  • on - (boolean) on/off (for DisplayList)
  • image - (Sprite object) seed sprite to get data from
  • fname - (string) Filename of image to load sprite data from.
  • name - (string) Sprite name/info
  • icolor - (string) icon color (for UserDisplay)
  • ifill - (string) icon fill (for UserDisplay)
  • centerorigin - (boolean; default=0) If 0, then the upper left corner of the sprite is 0,0 and increasing y goes DOWN, increase x goes RIGHT. If 1, then 0,0 is in the center of the sprite and increasing y goes UP and increase X goes RIGHT.
  • rotation - (float degrees) GL-pipeline rotation factor. Very fast pre-blit rotation.
  • contrast - (float 0-1.0) GL-pipeline contrast scaling factor. Very fast pre-blit scaling of all pixel values.
  • scale - (float) GL-pipeline spatial scaling factor. Very fast pre-blit scaling of all pixel values.
Overrides: object.__init__