Package pyjsdl :: Module surface :: Class Surface

Class Surface

pyjsobj.HTML5Canvas --+
                      |
                     Surface

pyjsdl.Surface

Instance Methods
 
__init__(self, size, *args, **kwargs)
Return Surface subclassed from a Canvas implementation. The size argument is the dimension (w,h) of surface.
 
__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.
 
resize(self, width, height)
Resize 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. The rect argument is the area of the subsurface. Argument can be 't'/'f' for data sync to/from subsurface.
 
getSubimage(self, x, y, width, height)
Return subimage of Surface. Arguments include x, y, width, and height of the subimage.
 
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)
Get color of a surface pixel. The pos argument represents x,y position of pixel. Return color (r,g,b,a) of a surface 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=None, rect=None)
Fill surface with color.
 
get_parent(self)
Return parent Surface of subsurface.
 
get_offset(self)
Return offset of subsurface in surface.
 
toDataURL(self, datatype=None)
Return surface data as a base64 data string. Optional datatype to set data format, default to 'image/png'. Implemented with HTML5 Canvas toDataURL method.
Method Details

__init__(self, size, *args, **kwargs)
(Constructor)

 

Return Surface subclassed from a Canvas implementation. The size argument is the dimension (w,h) of surface.

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