Package joy :: Module scope :: Class Glyph
[hide private]
[frames] | no frames]

Class Glyph

source code


Concrete class representing a bitmap that is placed at multiple locations on an image. Each Glyph has an image and a basepoint offset (which defaults to its center). The image is RGBA, so pixels may be made transparent.

By default, a Glyph contains a blue cross of the specified size, with lines 3 pixels wide. With size 5, this makes a good circular dot.

Instance Methods [hide private]
 
__init__(self, size, color=(0,0,128))
Create a glyph of the specified size and color.
source code
 
put(self, surf, x, y)
Put copies of the image at the specified points on the surface
source code

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, size, color=(0,0,128))
(Constructor)

source code 

Create a glyph of the specified size and color.

INPUTS:
  size -- number or pair -- size of glyph image
  
ATTRIBUTES:
  .ofs -- len 2 -- offset of basepoint into image
  .img -- pygame image of size size, mode RGBA -- the Glyph itself

Overrides: object.__init__

put(self, surf, x, y)

source code 

Put copies of the image at the specified points on the surface

INPUTS:
  surf -- pygame.Surface to draw on
  x,y -- sequences of equal length of x and y coordinates