Creates a new, empty BufferProxy.
A buffer interface object that acts as a proxy on classes and attributes not featuring the buffer interface. A BufferProxy usually should be constructed from C code, not Python.
Writes raw data to the BufferProxy.
Writes the raw data from buffer to the BufferProxy object, starting at the specified offset within the BufferProxy. If the length of the passed buffer exceeds the length of the BufferProxy (reduced by offset), an IndexError will be raised.
Creates a new Color object.
The Color class represents RGBA color values using a value range of 0-255. It allows basic arithmetic operations to create new colors, supports conversions to other color spaces such as HSV or HSL and lets you adjust single color channels. The following constructors are supported:
Example:
from pygame2 import Color
red = Color (255, 0, 0)
green = Color (0x0000FF00)
blue = Color ("blue")
Applies a certain gamma value to the Color.
Applies a certain gamma value to the Color and returns a new Color with the adjusted RGBA values.
Returns the normalized RGBA values of the Color.
Returns the normalized RGBA values of the Color as floating point values.
A class for storing rectangular coordinates.
A FRect is used to store and manipulate rectangular coordinates.
Creates a Rect from the specified FRect.
This creates a Rect using the smallest integral values greater or equal to the FRect floating point values.
Moves the rectangle inside another.
Returns a new rectangle that is moved to be completely inside the argument FRect. If the rectangle is too large to fit inside, it is centered inside the argument FRect, but its size is not changed.
Moves the rectangle inside another, in place.
Same as clamp(), but operates in place.
Crops a rectangle inside another.
Returns a new rectangle that is cropped to be completely inside the argument FRect. If the two rectangles do not overlap to begin with, a FRect with 0 size is returned. Thus it returns the area, in which both rects overlap.
Test if one rectangle in a dictionary intersects.
Returns the key and value of the first dictionary entry that collides with the FRect. If no collisions are found, None is returned. Depending on the checkvals argument either the keys or values of dict must be FRect objects. By default, the keys are checked.
You can provide your own comparision function as key argument. The comparision function will take two arguments, the FRect itself and a key or value from the passed dictionary. It must return True or False
def cmpfunc (rect1, rect2):
...
return True
Test if all rectangles in a dictionary intersect.
Returns a list of all the key and value pairs that intersect with the FRect. If no collisions are found an empty list is returned. Depending on the checkvals argument either the keys or values of the dict must be FRect objects. By default, the keys are checked.
You can provide your own comparision function as key argument. The comparision function will take two arguments, the FRect itself and a key or value from the passed dictionary. It must return True or False
def cmpfunc (rect1, rect2):
...
return True
Test if one rectangle in a list intersects.
Test whether the rectangle collides with any in a sequence of rectangles. The index of the first collision found is returned. If no collisions are found an index of -1 is returned.
You can provide your own comparision function as key argument. The comparision function will take two arguments, the FRect itself and a key or value from the passed dictionary. It must return True or False
def cmpfunc (rect1, rect2):
...
return True
Test if all rectangles in a list intersect.
Returns a list of all the indices that contain rectangles that collide with the FRect. If no intersecting rectangles are found, an empty list is returned.
You can provide your own comparision function as key argument. The comparision function will take two arguments, the FRect itself and a key or value from the passed dictionary. It must return True or False
def cmpfunc (rect1, rect2):
...
return True
Test if a point is inside a rectangle.
Returns True if the given point is inside the rectangle. A point along the right or bottom edge is not considered to be inside the rectangle.
Test if two rectangles overlap.
Returns True if any portion of either rectangle overlap (except the top+bottom or left+right edges).
Test if one rectangle is inside another.
Returns True when the argument rectangle is completely inside the FRect.
Creates a copy of the FRect.
Returns a new FRect, that contains the same values as the caller.
Resize and move a rectangle with aspect ratio.
Returns a new rectangle that is moved and resized to fit another. The aspect ratio of the original FRect is preserved, so the new rectangle may be smaller than the target in either width or height.
Creates a Rect from the specified FRect.
This creates a Rect using the largest integral values less than or equal to the FRect floating point values.
Grow or shrink the rectangle size.
Returns a new rectangle with the size changed by the given offset. The rectangle remains centered around its current center. Negative values will shrink the rectangle.
Grow or shrink the rectangle size, in place.
Same as inflate(), but operates in place.
Moves the rectangle.
Returns a new rectangle that is moved by the given offset. The x and y arguments can be any float or integer value, positive or negative.
Moves the rectangle, in place.
Same as move(), but operates in place.
Creates a Rect from the specified FRect.
This creates a Rect using the FRect floating point values rounded to the nearest integral value.
Creates a Rect from the specified FRect.
This creates a Rect using truncated integral values from the FRect floating point values.
Joins two rectangles into one.
Returns a new rectangle that completely covers the area of the two provided rectangles. There may be area inside the new FRect that is not covered by the originals.
Joins two rectangles into one, in place.
Same as union(), but operates in place.
A class for storing rectangular coordinates.
A Rect is used to store and manipulate rectangular coordinates.
Moves the rectangle inside another.
Returns a new rectangle that is moved to be completely inside the argument Rect. If the rectangle is too large to fit inside, it is centered inside the argument Rect, but its size is not changed.
Moves the rectangle inside another, in place.
Same as clamp(), but operates in place.
Crops a rectangle inside another.
Returns a new rectangle that is cropped to be completely inside the argument Rect. If the two rectangles do not overlap to begin with, a Rect with 0 size is returned. Thus it returns the area, in which both rects overlap.
Test if one rectangle in a dictionary intersects.
Returns the key and value of the first dictionary entry that collides with the Rect. If no collisions are found, None is returned. Depending on the checkvals argument either the keys or values of the dict must be Rect objects. By default, the keys are checked.
You can provide your own comparision function as key argument. The comparision function will take two arguments, the Rect itself and a key or value from the passed dictionary. It must return True or False
def cmpfunc (rect1, rect2):
...
return True
Test if all rectangles in a dictionary intersect.
Returns a list of all the key and value pairs that intersect with the Rect. If no collisions are found an empty list is returned. Depending on the checkvals argument either the keys or values of the dict must be Rect objects. By default, the keys are checked.
You can provide your own comparision function as key argument. The comparision function will take two arguments, the Rect itself and an key or value from the passed dictionary. It must return True or False
def cmpfunc (rect1, rect2):
...
return True
Test if one rectangle in a list intersects.
Test whether the rectangle collides with any in a sequence of rectangles. The index of the first collision found is returned. If no collisions are found an index of -1 is returned.
You can provide your own comparision function as key argument. The comparision function will take two arguments, the Rect itself and an key or value from the passed dictionary. It must return True or False
def cmpfunc (rect1, rect2):
...
return True
Test if all rectangles in a list intersect.
Returns a list of all the indices that contain rectangles that collide with the Rect. If no intersecting rectangles are found, an empty list is returned.
You can provide your own comparision function as key argument. The comparision function will take two arguments, the Rect itself and an key or value from the passed dictionary. It must return True or False
def cmpfunc (rect1, rect2):
...
return True
Test if a point is inside a rectangle.
Returns True if the given point is inside the rectangle. A point along the right or bottom edge is not considered to be inside the rectangle.
Test if two rectangles overlap.
Returns True if any portion of either rectangle overlap (except the top+bottom or left+right edges).
Test if one rectangle is inside another.
Returns True when the argument rectangle is completely inside the Rect.
Creates a copy of the Rect.
Returns a new Rect, that contains the same values as the caller.
Resize and move a rectangle with aspect ratio.
Returns a new rectangle that is moved and resized to fit another. The aspect ratio of the original Rect is preserved, so the new rectangle may be smaller than the target in either width or height.
Grow or shrink the rectangle size.
Returns a new rectangle with the size changed by the given offset. The rectangle remains centered around its current center. Negative values will shrink the rectangle.
Grow or shrink the rectangle size, in place.
Same as inflate(), but operates in place.
Moves the rectangle.
Returns a new rectangle that is moved by the given offset. The x and y arguments can be any integer value, positive or negative.
Moves the rectangle, in place.
Same as move(), but operates in place.
Joins two rectangles into one.
Returns a new rectangle that completely covers the area of the two provided rectangles. There may be area inside the new Rect that is not covered by the originals.
Joins two rectangles into one, in place.
Same as union(), but operates in place.
An abstract base class for arbitrary Surface objects.
You should not instantiate this class directly.
An abstract base class for arbitrary Font objects.
You should not instantiate this class directly.