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

Class TextSprite

source code

object --+
         |
        TextSprite

Sprite-like Text object.

This is a like a sprite, but instead of image data, has text.

Instance Methods
 
__init__(self, x, y, s, fb=None, fg=(255,1,1), bg=None, rotation=0, size=30, on=1, depth=0, name=None)
TextSprite instantiation method
source code
 
__repr__(self)
repr(x)
source code
 
clone(self) source code
 
moveto(self, x, y)
Absolute move.
source code
 
rmove(self, dx, dy)
Relative move.
source code
 
blit(self, flip=None, force=None)
Draw TextSprite.
source code
 
on(self)
Turn TextSprite on.
source code
 
off(self)
Turn TextSprite off.
source code
 
toggle(self)
Toggle TextSprite (off->on or on->off)
source code
 
set(self, text) source code

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

Properties

Inherited from object: __class__

Method Details

__init__(self, x, y, s, fb=None, fg=(255,1,1), bg=None, rotation=0, size=30, on=1, depth=0, name=None)
(Constructor)

source code 
TextSprite instantiation method
Parameters:
  • x, y - (pixels) center position
  • s - (string) text to display
  • fb - framebuffer
  • bg, bg - fg/bg color (bg=None for no background/transparent)
  • rotation - (deg)
  • size - (pix height)
  • on - (boolean) just like regular Sprite class
  • depth - depth of sprite (for DisplayList below). The DisplayList class draws sprites in depth order, with large depths being draw first (ie, 0 is the top-most layer of sprites)
  • name - debugging name (string) of the sprite; if not set, then either the filename or a unique random name is used instead.
Overrides: object.__init__

__repr__(self)
(Representation operator)

source code 
repr(x)
Overrides: object.__repr__
(inherited documentation)