| |
- __builtin__.object
-
- Color
- PixelArray
- Rect
- Surface
- Surface
- overlay
- exceptions.RuntimeError(exceptions.StandardError)
-
- error
class Color(__builtin__.object) |
|
pygame.Color(name): Return Color
pygame.Color(r, g, b, a): Return Color
pygame.Color(rgbvalue): Return Color
pygame object for color representations |
|
Methods defined here:
- __add__(...)
- x.__add__(y) <==> x+y
- __coerce__(...)
- x.__coerce__(y) <==> coerce(x, y)
- __delitem__(...)
- x.__delitem__(y) <==> del x[y]
- __div__(...)
- x.__div__(y) <==> x/y
- __eq__(...)
- x.__eq__(y) <==> x==y
- __float__(...)
- x.__float__() <==> float(x)
- __floordiv__(...)
- x.__floordiv__(y) <==> x//y
- __ge__(...)
- x.__ge__(y) <==> x>=y
- __getitem__(...)
- x.__getitem__(y) <==> x[y]
- __getslice__(...)
- x.__getslice__(i, j) <==> x[i:j]
Use of negative indices is not supported.
- __gt__(...)
- x.__gt__(y) <==> x>y
- __hex__(...)
- x.__hex__() <==> hex(x)
- __index__(...)
- x[y:z] <==> x[y.__index__():z.__index__()]
- __int__(...)
- x.__int__() <==> int(x)
- __invert__(...)
- x.__invert__() <==> ~x
- __le__(...)
- x.__le__(y) <==> x<=y
- __len__(...)
- x.__len__() <==> len(x)
- __long__(...)
- x.__long__() <==> long(x)
- __lt__(...)
- x.__lt__(y) <==> x<y
- __mod__(...)
- x.__mod__(y) <==> x%y
- __mul__(...)
- x.__mul__(y) <==> x*y
- __ne__(...)
- x.__ne__(y) <==> x!=y
- __oct__(...)
- x.__oct__() <==> oct(x)
- __radd__(...)
- x.__radd__(y) <==> y+x
- __rdiv__(...)
- x.__rdiv__(y) <==> y/x
- __repr__(...)
- x.__repr__() <==> repr(x)
- __rfloordiv__(...)
- x.__rfloordiv__(y) <==> y//x
- __rmod__(...)
- x.__rmod__(y) <==> y%x
- __rmul__(...)
- x.__rmul__(y) <==> y*x
- __rsub__(...)
- x.__rsub__(y) <==> y-x
- __setitem__(...)
- x.__setitem__(i, y) <==> x[i]=y
- __sub__(...)
- x.__sub__(y) <==> x-y
- correct_gamma(...)
- Color.correct_gamma (gamma): Return Color
Applies a certain gamma value to the Color.
- normalize(...)
- Color.normalize(): Return tuple
Returns the normalized RGBA values of the Color.
- set_length(...)
- Color.set_length(len)
Set the number of elements in the Color to 1,2,3, or 4.
Data descriptors defined here:
- a
- Color.a: Return int
Gets or sets the alpha value of the Color.
- b
- Color.b: Return int
Gets or sets the blue value of the Color.
- cmy
- Color.cmy: Return tuple
Gets or sets the CMY representation of the Color.
- g
- Color.g: Return int
Gets or sets the green value of the Color.
- hsla
- Color.hsla: Return tuple
Gets or sets the HSLA representation of the Color.
- hsva
- Color.hsva: Return tuple
Gets or sets the HSVA representation of the Color.
- i1i2i3
- Color.i1i2i3: Return tuple
Gets or sets the I1I2I3 representation of the Color.
- r
- Color.r: Return int
Gets or sets the red value of the Color.
Data and other attributes defined here:
- __new__ = <built-in method __new__ of type object>
- T.__new__(S, ...) -> a new object with type S, a subtype of T
|
class PixelArray(__builtin__.object) |
|
pygame.PixelArray(Surface): return PixelArray
pygame object for direct pixel access of surfaces |
|
Methods defined here:
- __contains__(...)
- x.__contains__(y) <==> y in x
- __delitem__(...)
- x.__delitem__(y) <==> del x[y]
- __delslice__(...)
- x.__delslice__(i, j) <==> del x[i:j]
Use of negative indices is not supported.
- __getitem__(...)
- x.__getitem__(y) <==> x[y]
- __getslice__(...)
- x.__getslice__(i, j) <==> x[i:j]
Use of negative indices is not supported.
- __iter__(...)
- x.__iter__() <==> iter(x)
- __len__(...)
- x.__len__() <==> len(x)
- __repr__(...)
- x.__repr__() <==> repr(x)
- __setitem__(...)
- x.__setitem__(i, y) <==> x[i]=y
- __setslice__(...)
- x.__setslice__(i, j, y) <==> x[i:j]=y
Use of negative indices is not supported.
- compare(...)
- PixelArray.compare (array, distance=0, weights=(0.299, 0.587, 0.114)): Return PixelArray
Compares the PixelArray with another one.
- extract(...)
- PixelArray.extract (color, distance=0, weights=(0.299, 0.587, 0.114)): Return PixelArray
Extracts the passed color from the PixelArray.
- make_surface(...)
- PixelArray.make_surface (): Return Surface
Creates a new Surface from the current PixelArray.
- replace(...)
- PixelArray.replace (color, repcolor, distance=0, weights=(0.299, 0.587, 0.114)): Return None
Replaces the passed color in the PixelArray with another one.
Data descriptors defined here:
- __dict__
- surface
- PixelArray.surface: Return Surface
Gets the Surface the PixelArray uses.
Data and other attributes defined here:
- __new__ = <built-in method __new__ of type object>
- T.__new__(S, ...) -> a new object with type S, a subtype of T
|
class Rect(__builtin__.object) |
|
pygame.Rect(left, top, width, height): return Rect
pygame.Rect((left, top), (width, height)): return Rect
pygame.Rect(object): return Rect
pygame object for storing rectangular coordinates |
|
Methods defined here:
- __coerce__(...)
- x.__coerce__(y) <==> coerce(x, y)
- __copy__(...)
- __delitem__(...)
- x.__delitem__(y) <==> del x[y]
- __delslice__(...)
- x.__delslice__(i, j) <==> del x[i:j]
Use of negative indices is not supported.
- __eq__(...)
- x.__eq__(y) <==> x==y
- __ge__(...)
- x.__ge__(y) <==> x>=y
- __getitem__(...)
- x.__getitem__(y) <==> x[y]
- __getslice__(...)
- x.__getslice__(i, j) <==> x[i:j]
Use of negative indices is not supported.
- __gt__(...)
- x.__gt__(y) <==> x>y
- __init__(...)
- x.__init__(...) initializes x; see help(type(x)) for signature
- __le__(...)
- x.__le__(y) <==> x<=y
- __len__(...)
- x.__len__() <==> len(x)
- __lt__(...)
- x.__lt__(y) <==> x<y
- __ne__(...)
- x.__ne__(y) <==> x!=y
- __nonzero__(...)
- x.__nonzero__() <==> x != 0
- __reduce__(...)
- __repr__(...)
- x.__repr__() <==> repr(x)
- __setitem__(...)
- x.__setitem__(i, y) <==> x[i]=y
- __setslice__(...)
- x.__setslice__(i, j, y) <==> x[i:j]=y
Use of negative indices is not supported.
- __str__(...)
- x.__str__() <==> str(x)
- clamp(...)
- Rect.clamp(Rect): return Rect
moves the rectangle inside another
- clamp_ip(...)
- Rect.clamp_ip(Rect): return None
moves the rectangle inside another, in place
- clip(...)
- Rect.clip(Rect): return Rect
crops a rectangle inside another
- collidedict(...)
- Rect.collidedict(dict): return (key, value)
test if one rectangle in a dictionary intersects
- collidedictall(...)
- Rect.collidedictall(dict): return [(key, value), ...]
test if all rectangles in a dictionary intersect
- collidelist(...)
- Rect.collidelist(list): return index
test if one rectangle in a list intersects
- collidelistall(...)
- Rect.collidelistall(list): return indices
test if all rectangles in a list intersect
- collidepoint(...)
- Rect.collidepoint(x, y): return bool
Rect.collidepoint((x,y)): return bool
test if a point is inside a rectangle
- colliderect(...)
- Rect.colliderect(Rect): return bool
test if two rectangles overlap
- contains(...)
- Rect.contains(Rect): return bool
test if one rectangle is inside another
- copy(...)
- Rect.copy(): return Rect
copy the rectangle
- fit(...)
- Rect.fit(Rect): return Rect
resize and move a rectangle with aspect ratio
- inflate(...)
- Rect.inflate(x, y): return Rect
grow or shrink the rectangle size
- inflate_ip(...)
- Rect.inflate_ip(x, y): return None
grow or shrink the rectangle size, in place
- move(...)
- Rect.move(x, y): return Rect
moves the rectangle
- move_ip(...)
- Rect.move_ip(x, y): return None
moves the rectangle, in place
- normalize(...)
- Rect.normalize(): return None
correct negative sizes
- union(...)
- Rect.union(Rect): return Rect
joins two rectangles into one
- union_ip(...)
- Rect.union_ip(Rect): return None
joins two rectangles into one, in place
- unionall(...)
- Rect.unionall(Rect_sequence): return Rect
the union of many rectangles
- unionall_ip(...)
- Rect.unionall_ip(Rect_sequence): return None
the union of many rectangles, in place
Data descriptors defined here:
- __safe_for_unpickling__
- bottom
- bottomleft
- bottomright
- center
- centerx
- centery
- h
- height
- left
- midbottom
- midleft
- midright
- midtop
- right
- size
- top
- topleft
- topright
- w
- width
- x
- y
Data and other attributes defined here:
- __new__ = <built-in method __new__ of type object>
- T.__new__(S, ...) -> a new object with type S, a subtype of T
|
class Surface(__builtin__.object) |
|
pygame.Surface((width, height), flags=0, depth=0, masks=None): return Surface
pygame.Surface((width, height), flags=0, Surface): return Surface
pygame object for representing images |
|
Methods defined here:
- __copy__(...)
- Surface.copy(): return Surface
create a new copy of a Surface
- __init__(...)
- x.__init__(...) initializes x; see help(type(x)) for signature
- __repr__(...)
- x.__repr__() <==> repr(x)
- blit(...)
- Surface.blit(source, dest, area=None, special_flags = 0): return Rect
draw one image onto another
- convert(...)
- Surface.convert(Surface): return Surface
Surface.convert(depth, flags=0): return Surface
Surface.convert(masks, flags=0): return Surface
Surface.convert(): return Surface
change the pixel format of an image
- convert_alpha(...)
- Surface.convert_alpha(Surface): return Surface
Surface.convert_alpha(): return Surface
change the pixel format of an image including per pixel alphas
- copy(...)
- Surface.copy(): return Surface
create a new copy of a Surface
- fill(...)
- Surface.fill(color, rect=None, special_flags=0): return Rect
fill Surface with a solid color
- get_abs_offset(...)
- Surface.get_abs_offset(): return (x, y)
find the absolute position of a child subsurface inside its top level parent
- get_abs_parent(...)
- Surface.get_abs_parent(): return Surface
find the top level parent of a subsurface
- get_alpha(...)
- Surface.get_alpha(): return int_value or None
get the current Surface transparency value
- get_at(...)
- Surface.get_at((x, y)): return Color
get the color value at a single pixel
- get_bitsize(...)
- Surface.get_bitsize(): return int
get the bit depth of the Surface pixel format
- get_bounding_rect(...)
- Surface.get_bounding_rect(min_alpha = 1): return Rect
find the smallest rect containing data
- get_buffer(...)
- Surface.get_buffer(): return BufferProxy
acquires a buffer object for the pixels of the Surface.
- get_bytesize(...)
- Surface.get_bytesize(): return int
get the bytes used per Surface pixel
- get_clip(...)
- Surface.get_clip(): return Rect
get the current clipping area of the Surface
- get_colorkey(...)
- Surface.get_colorkey(): return RGB or None
Get the current transparent colorkey
- get_flags(...)
- Surface.get_flags(): return int
get the additional flags used for the Surface
- get_height(...)
- Surface.get_height(): return height
get the height of the Surface
- get_locked(...)
- Surface.get_locked(): return bool
test if the Surface is current locked
- get_locks(...)
- Surface.get_locks(): return tuple
Gets the locks for the Surface
- get_losses(...)
- Surface.get_losses(): return (R, G, B, A)
the significant bits used to convert between a color and a mapped integer
- get_masks(...)
- Surface.get_masks(): return (R, G, B, A)
the bitmasks needed to convert between a color and a mapped integer
- get_offset(...)
- Surface.get_offset(): return (x, y)
find the position of a child subsurface inside a parent
- get_palette(...)
- Surface.get_palette(): return [RGB, RGB, RGB, ...]
get the color index palette for an 8bit Surface
- get_palette_at(...)
- Surface.get_palette_at(index): return RGB
get the color for a single entry in a palette
- get_parent(...)
- Surface.get_parent(): return Surface
find the parent of a subsurface
- get_pitch(...)
- Surface.get_pitch(): return int
get the number of bytes used per Surface row
- get_rect(...)
- Surface.get_rect(**kwargs): return Rect
get the rectangular area of the Surface
- get_shifts(...)
- Surface.get_shifts(): return (R, G, B, A)
the bit shifts needed to convert between a color and a mapped integer
- get_size(...)
- Surface.get_size(): return (width, height)
get the dimensions of the Surface
- get_width(...)
- Surface.get_width(): return width
get the width of the Surface
- lock(...)
- Surface.lock(): return None
lock the Surface memory for pixel access
- map_rgb(...)
- Surface.map_rgb(Color): return mapped_int
convert a color into a mapped color value
- mustlock(...)
- Surface.mustlock(): return bool
test if the Surface requires locking
- scroll(...)
- Surface.scroll(dx=0, dy=0): return None
Shift the surface image in place
- set_alpha(...)
- Surface.set_alpha(value, flags=0): return None
Surface.set_alpha(None): return None
set the alpha value for the full Surface image
- set_at(...)
- Surface.set_at((x, y), Color): return None
set the color value for a single pixel
- set_clip(...)
- Surface.set_clip(rect): return None
Surface.set_clip(None): return None
set the current clipping area of the Surface
- set_colorkey(...)
- Surface.set_colorkey(Color, flags=0): return None
Surface.set_colorkey(None): return None
Set the transparent colorkey
- set_masks(...)
- Surface.set_masks((r,g,b,a)): return None
set the bitmasks needed to convert between a color and a mapped integer
- set_palette(...)
- Surface.set_palette([RGB, RGB, RGB, ...]): return None
set the color palette for an 8bit Surface
- set_palette_at(...)
- Surface.set_at(index, RGB): return None
set the color for a single index in an 8bit Surface palette
- set_shifts(...)
- Surface.get_shifts((r,g,b,a)): return None
sets the bit shifts needed to convert between a color and a mapped integer
- subsurface(...)
- Surface.subsurface(Rect): return Surface
create a new surface that references its parent
- unlock(...)
- Surface.unlock(): return None
unlock the Surface memory from pixel access
- unmap_rgb(...)
- Surface.map_rgb(mapped_int): return Color
convert a mapped integer color value into a Color
Data and other attributes defined here:
- __new__ = <built-in method __new__ of type object>
- T.__new__(S, ...) -> a new object with type S, a subtype of T
|
SurfaceType = class Surface(__builtin__.object) |
|
pygame.Surface((width, height), flags=0, depth=0, masks=None): return Surface
pygame.Surface((width, height), flags=0, Surface): return Surface
pygame object for representing images |
|
Methods defined here:
- __copy__(...)
- Surface.copy(): return Surface
create a new copy of a Surface
- __init__(...)
- x.__init__(...) initializes x; see help(type(x)) for signature
- __repr__(...)
- x.__repr__() <==> repr(x)
- blit(...)
- Surface.blit(source, dest, area=None, special_flags = 0): return Rect
draw one image onto another
- convert(...)
- Surface.convert(Surface): return Surface
Surface.convert(depth, flags=0): return Surface
Surface.convert(masks, flags=0): return Surface
Surface.convert(): return Surface
change the pixel format of an image
- convert_alpha(...)
- Surface.convert_alpha(Surface): return Surface
Surface.convert_alpha(): return Surface
change the pixel format of an image including per pixel alphas
- copy(...)
- Surface.copy(): return Surface
create a new copy of a Surface
- fill(...)
- Surface.fill(color, rect=None, special_flags=0): return Rect
fill Surface with a solid color
- get_abs_offset(...)
- Surface.get_abs_offset(): return (x, y)
find the absolute position of a child subsurface inside its top level parent
- get_abs_parent(...)
- Surface.get_abs_parent(): return Surface
find the top level parent of a subsurface
- get_alpha(...)
- Surface.get_alpha(): return int_value or None
get the current Surface transparency value
- get_at(...)
- Surface.get_at((x, y)): return Color
get the color value at a single pixel
- get_bitsize(...)
- Surface.get_bitsize(): return int
get the bit depth of the Surface pixel format
- get_bounding_rect(...)
- Surface.get_bounding_rect(min_alpha = 1): return Rect
find the smallest rect containing data
- get_buffer(...)
- Surface.get_buffer(): return BufferProxy
acquires a buffer object for the pixels of the Surface.
- get_bytesize(...)
- Surface.get_bytesize(): return int
get the bytes used per Surface pixel
- get_clip(...)
- Surface.get_clip(): return Rect
get the current clipping area of the Surface
- get_colorkey(...)
- Surface.get_colorkey(): return RGB or None
Get the current transparent colorkey
- get_flags(...)
- Surface.get_flags(): return int
get the additional flags used for the Surface
- get_height(...)
- Surface.get_height(): return height
get the height of the Surface
- get_locked(...)
- Surface.get_locked(): return bool
test if the Surface is current locked
- get_locks(...)
- Surface.get_locks(): return tuple
Gets the locks for the Surface
- get_losses(...)
- Surface.get_losses(): return (R, G, B, A)
the significant bits used to convert between a color and a mapped integer
- get_masks(...)
- Surface.get_masks(): return (R, G, B, A)
the bitmasks needed to convert between a color and a mapped integer
- get_offset(...)
- Surface.get_offset(): return (x, y)
find the position of a child subsurface inside a parent
- get_palette(...)
- Surface.get_palette(): return [RGB, RGB, RGB, ...]
get the color index palette for an 8bit Surface
- get_palette_at(...)
- Surface.get_palette_at(index): return RGB
get the color for a single entry in a palette
- get_parent(...)
- Surface.get_parent(): return Surface
find the parent of a subsurface
- get_pitch(...)
- Surface.get_pitch(): return int
get the number of bytes used per Surface row
- get_rect(...)
- Surface.get_rect(**kwargs): return Rect
get the rectangular area of the Surface
- get_shifts(...)
- Surface.get_shifts(): return (R, G, B, A)
the bit shifts needed to convert between a color and a mapped integer
- get_size(...)
- Surface.get_size(): return (width, height)
get the dimensions of the Surface
- get_width(...)
- Surface.get_width(): return width
get the width of the Surface
- lock(...)
- Surface.lock(): return None
lock the Surface memory for pixel access
- map_rgb(...)
- Surface.map_rgb(Color): return mapped_int
convert a color into a mapped color value
- mustlock(...)
- Surface.mustlock(): return bool
test if the Surface requires locking
- scroll(...)
- Surface.scroll(dx=0, dy=0): return None
Shift the surface image in place
- set_alpha(...)
- Surface.set_alpha(value, flags=0): return None
Surface.set_alpha(None): return None
set the alpha value for the full Surface image
- set_at(...)
- Surface.set_at((x, y), Color): return None
set the color value for a single pixel
- set_clip(...)
- Surface.set_clip(rect): return None
Surface.set_clip(None): return None
set the current clipping area of the Surface
- set_colorkey(...)
- Surface.set_colorkey(Color, flags=0): return None
Surface.set_colorkey(None): return None
Set the transparent colorkey
- set_masks(...)
- Surface.set_masks((r,g,b,a)): return None
set the bitmasks needed to convert between a color and a mapped integer
- set_palette(...)
- Surface.set_palette([RGB, RGB, RGB, ...]): return None
set the color palette for an 8bit Surface
- set_palette_at(...)
- Surface.set_at(index, RGB): return None
set the color for a single index in an 8bit Surface palette
- set_shifts(...)
- Surface.get_shifts((r,g,b,a)): return None
sets the bit shifts needed to convert between a color and a mapped integer
- subsurface(...)
- Surface.subsurface(Rect): return Surface
create a new surface that references its parent
- unlock(...)
- Surface.unlock(): return None
unlock the Surface memory from pixel access
- unmap_rgb(...)
- Surface.map_rgb(mapped_int): return Color
convert a mapped integer color value into a Color
Data and other attributes defined here:
- __new__ = <built-in method __new__ of type object>
- T.__new__(S, ...) -> a new object with type S, a subtype of T
|
|