Package pyj2d :: Module surface :: Class Surface

Class Surface

java.awt.image.BufferedImage --+
                               |
                              Surface

pyj2d.Surface

Instance Methods
 
__init__(self, *arg)
Return Surface that is subclassed from java.awt.image.BufferedImage.
 
__str__(self)
 
__repr__(self)
 
get_size(self)
Return width and height of surface.
 
get_width(self)
Return width of surface.
 
get_height(self)
Return height of surface.
 
get_rect(self, **attr)
Return rect of the surface. An optional keyword argument of the rect position.
 
copy(self)
Return Surface that is a copy of this surface.
 
subsurface(self, rect)
Return Surface that represents a subsurface that shares data with this surface. The rect argument is the area of the subsurface.
 
blit(self, surface, position, area=None)
Draw given surface on this surface at position. Optional area delimitates the region of given surface to draw.
 
set_colorkey(self, color, flags=None)
Set surface colorkey.
 
get_colorkey(self)
Return surface colorkey.
 
replace_color(self, color, new_color=None)
Replace color with with new_color or with alpha.
 
get_at(self, pos)
Return color of a surface pixel. The pos argument represents x,y position of pixel.
 
set_at(self, pos, color)
Set color of a surface pixel. The arguments represent position x,y and color of pixel.
 
fill(self, color=(0,0,0), rect=None)
Fill surface with color.
 
get_parent(self)
Return parent Surface of subsurface.
 
get_offset(self)
Return offset of subsurface in surface.
Method Details

__init__(self, *arg)
(Constructor)

 

Return Surface that is subclassed from java.awt.image.BufferedImage.

Alternative arguments:

  • Size (w,h) of surface, optional second argument of flags (SRCALPHA)
  • Bufferedimage to convert to Surface

Module initialization places pyj2d.Surface in module's namespace.