doc_content stringlengths 1 386k | doc_id stringlengths 5 188 |
|---|---|
pygame.fastevent.post()
place an event on the queue post(Event) -> None This will post your own event objects onto the event queue. You can post any event type you want, but some care must be taken. For example, if you post a MOUSEBUTTONDOWN event to the queue, it is likely any code receiving the event will expect t... | pygame.ref.fastevent#pygame.fastevent.post |
pygame.fastevent.pump()
internally process pygame event handlers pump() -> None For each frame of your game, you will need to make some sort of call to the event queue. This ensures your program can internally interact with the rest of the operating system. This function is not necessary if your program is consisten... | pygame.ref.fastevent#pygame.fastevent.pump |
pygame.fastevent.wait()
wait for an event wait() -> Event Returns the current event on the queue. If there are no messages waiting on the queue, this will not return until one is available. Sometimes it is important to use this wait to get events from the queue, it will allow your application to idle when the user i... | pygame.ref.fastevent#pygame.fastevent.wait |
pygame.font
pygame module for loading and rendering fonts The font module allows for rendering TrueType fonts into a new Surface object. It accepts any UCS-2 character ('u0001' to 'uFFFF'). This module is optional and requires SDL_ttf as a dependency. You should test that pygame.font is available and initialized b... | pygame.ref.font |
pygame.font.Font
create a new Font object from a file Font(filename, size) -> Font Font(object, size) -> Font Load a new font from a given filename or a python file object. The size is the height of the font in pixels. If the filename is None the pygame default font will be loaded. If a font cannot be loaded from th... | pygame.ref.font#pygame.font.Font |
bold
Gets or sets whether the font should be rendered in (faked) bold. bold -> bool Whether the font should be rendered in bold. When set to True, this enables the bold rendering of text. This is a fake stretching of the font that doesn't look good on many font types. If possible load the font from a real bold font ... | pygame.ref.font#pygame.font.Font.bold |
get_ascent()
get the ascent of the font get_ascent() -> int Return the height in pixels for the font ascent. The ascent is the number of pixels from the font baseline to the top of the font. | pygame.ref.font#pygame.font.Font.get_ascent |
get_bold()
check if text will be rendered bold get_bold() -> bool Return True when the font bold rendering mode is enabled. Note This is the same as the bold attribute. | pygame.ref.font#pygame.font.Font.get_bold |
get_descent()
get the descent of the font get_descent() -> int Return the height in pixels for the font descent. The descent is the number of pixels from the font baseline to the bottom of the font. | pygame.ref.font#pygame.font.Font.get_descent |
get_height()
get the height of the font get_height() -> int Return the height in pixels of the actual rendered text. This is the average size for each glyph in the font. | pygame.ref.font#pygame.font.Font.get_height |
get_italic()
check if the text will be rendered italic get_italic() -> bool Return True when the font italic rendering mode is enabled. Note This is the same as the italic attribute. | pygame.ref.font#pygame.font.Font.get_italic |
get_linesize()
get the line space of the font text get_linesize() -> int Return the height in pixels for a line of text with the font. When rendering multiple lines of text this is the recommended amount of space between lines. | pygame.ref.font#pygame.font.Font.get_linesize |
get_underline()
check if text will be rendered with an underline get_underline() -> bool Return True when the font underline is enabled.
Note This is the same as the underline attribute. | pygame.ref.font#pygame.font.Font.get_underline |
italic
Gets or sets whether the font should be rendered in (faked) italics. italic -> bool Whether the font should be rendered in italic. When set to True, this enables fake rendering of italic text. This is a fake skewing of the font that doesn't look good on many font types. If possible load the font from a real i... | pygame.ref.font#pygame.font.Font.italic |
metrics()
gets the metrics for each character in the passed string metrics(text) -> list The list contains tuples for each character, which contain the minimum X offset, the maximum X offset, the minimum Y offset, the maximum Y offset and the advance offset (bearing plus width) of the character. [(minx, maxx, miny, ... | pygame.ref.font#pygame.font.Font.metrics |
render()
draw text on a new Surface render(text, antialias, color, background=None) -> Surface This creates a new Surface with the specified text rendered on it. pygame provides no way to directly draw text on an existing Surface: instead you must use Font.render() to create an image (Surface) of the text, then blit... | pygame.ref.font#pygame.font.Font.render |
set_bold()
enable fake rendering of bold text set_bold(bool) -> None Enables the bold rendering of text. This is a fake stretching of the font that doesn't look good on many font types. If possible load the font from a real bold font file. While bold, the font will have a different width than when normal. This can b... | pygame.ref.font#pygame.font.Font.set_bold |
set_italic()
enable fake rendering of italic text set_italic(bool) -> None Enables fake rendering of italic text. This is a fake skewing of the font that doesn't look good on many font types. If possible load the font from a real italic font file. While italic the font will have a different width than when normal. T... | pygame.ref.font#pygame.font.Font.set_italic |
set_underline()
control if text is rendered with an underline set_underline(bool) -> None When enabled, all rendered fonts will include an underline. The underline is always one pixel thick, regardless of font size. This can be mixed with the bold and italic modes. Note This is the same as the underline attribute. | pygame.ref.font#pygame.font.Font.set_underline |
size()
determine the amount of space needed to render text size(text) -> (width, height) Returns the dimensions needed to render the text. This can be used to help determine the positioning needed for text before it is rendered. It can also be used for wordwrapping and other layout effects. Be aware that most fonts ... | pygame.ref.font#pygame.font.Font.size |
underline
Gets or sets whether the font should be rendered with an underline. underline -> bool Whether the font should be rendered in underline. When set to True, all rendered fonts will include an underline. The underline is always one pixel thick, regardless of font size. This can be mixed with the bold and itali... | pygame.ref.font#pygame.font.Font.underline |
pygame.font.get_default_font()
get the filename of the default font get_default_font() -> string Return the filename of the system font. This is not the full path to the file. This file can usually be found in the same directory as the font module, but it can also be bundled in separate archives. | pygame.ref.font#pygame.font.get_default_font |
pygame.font.get_fonts()
get all available fonts get_fonts() -> list of strings Returns a list of all the fonts available on the system. The names of the fonts will be set to lowercase with all spaces and punctuation removed. This works on most systems, but some will return an empty list if they cannot find fonts. | pygame.ref.font#pygame.font.get_fonts |
pygame.font.get_init()
true if the font module is initialized get_init() -> bool Test if the font module is initialized or not. | pygame.ref.font#pygame.font.get_init |
pygame.font.init()
initialize the font module init() -> None This method is called automatically by pygame.init(). It initializes the font module. The module must be initialized before any other functions will work. It is safe to call this function more than once. | pygame.ref.font#pygame.font.init |
pygame.font.match_font()
find a specific font on the system match_font(name, bold=False, italic=False) -> path Returns the full path to a font file on the system. If bold or italic are set to true, this will attempt to find the correct family of font. The font name can also be an iterable of font names, a string of ... | pygame.ref.font#pygame.font.match_font |
pygame.font.quit()
uninitialize the font module quit() -> None Manually uninitialize SDL_ttf's font system. This is called automatically by pygame.quit(). It is safe to call this function even if font is currently not initialized. | pygame.ref.font#pygame.font.quit |
pygame.font.SysFont()
create a Font object from the system fonts SysFont(name, size, bold=False, italic=False) -> Font Return a new Font object that is loaded from the system fonts. The font will match the requested bold and italic flags. Pygame uses a small set of common font aliases. If the specific font you ask f... | pygame.ref.font#pygame.font.SysFont |
pygame.freetype
Enhanced pygame module for loading and rendering computer fonts The pygame.freetype module is a replacement for pygame.font. It has all of the functionality of the original, plus many new features. Yet is has absolutely no dependencies on the SDL_ttf library. It is implemented directly on the FreeT... | pygame.ref.freetype |
pygame.freetype.Font
Create a new Font instance from a supported font file. Font(file, size=0, font_index=0, resolution=0, ucs4=False) -> Font Argument file can be either a string representing the font's filename, a file-like object containing the font, or None; if None, a default, Pygame, font is used. Optionally, ... | pygame.ref.freetype#pygame.freetype.Font |
antialiased
Font anti-aliasing mode antialiased -> bool Gets or sets the font's anti-aliasing mode. This defaults to True on all fonts, which are rendered with full 8 bit blending. Set to False to do monochrome rendering. This should provide a small speed gain and reduce cache memory size. | pygame.ref.freetype#pygame.freetype.Font.antialiased |
ascender
The unscaled ascent of the font in font units ascender -> int Read only. Return the number of units from the font's baseline to the top of the bounding box. | pygame.ref.freetype#pygame.freetype.Font.ascender |
bgcolor
default background color bgcolor -> Color Gets or sets the default background rendering color. Initially it is unset and text will render with a transparent background by default. Applies to render() and render_to(). | pygame.ref.freetype#pygame.freetype.Font.bgcolor |
descender
The unscaled descent of the font in font units descender -> int Read only. Return the height in font units for the font descent. The descent is the number of units from the font's baseline to the bottom of the bounding box. | pygame.ref.freetype#pygame.freetype.Font.descender |
fgcolor
default foreground color fgcolor -> Color Gets or sets the default glyph rendering color. It is initially opaque black ― (0, 0, 0, 255). Applies to render() and render_to(). | pygame.ref.freetype#pygame.freetype.Font.fgcolor |
fixed_sizes
the number of available bitmap sizes for the font fixed_sizes -> int Read only. Returns the number of point sizes for which the font contains bitmap character images. If zero then the font is not a bitmap font. A scalable font may contain pre-rendered point sizes as strikes. | pygame.ref.freetype#pygame.freetype.Font.fixed_sizes |
fixed_width
Gets whether the font is fixed-width fixed_width -> bool Read only. Returns True if the font contains fixed-width characters (for example Courier, Bitstream Vera Sans Mono, Andale Mono). | pygame.ref.freetype#pygame.freetype.Font.fixed_width |
get_metrics()
Return the glyph metrics for the given text get_metrics(text, size=0) -> [(...), ...] Returns the glyph metrics for each character in text. The glyph metrics are returned as a list of tuples. Each tuple gives metrics of a single character glyph. The glyph metrics are: (min_x, max_x, min_y, max_y, horiz... | pygame.ref.freetype#pygame.freetype.Font.get_metrics |
get_rect()
Return the size and offset of rendered text get_rect(text, style=STYLE_DEFAULT, rotation=0, size=0) -> rect Gets the final dimensions and origin, in pixels, of text using the optional size in points, style, and rotation. For other relevant render properties, and for any optional argument not given, the de... | pygame.ref.freetype#pygame.freetype.Font.get_rect |
get_sized_ascender()
The scaled ascent of the font in pixels get_sized_ascender(<size>=0) -> int Return the number of units from the font's baseline to the top of the bounding box. It is not adjusted for strong or rotation. | pygame.ref.freetype#pygame.freetype.Font.get_sized_ascender |
get_sized_descender()
The scaled descent of the font in pixels get_sized_descender(<size>=0) -> int Return the number of pixels from the font's baseline to the top of the bounding box. It is not adjusted for strong or rotation. | pygame.ref.freetype#pygame.freetype.Font.get_sized_descender |
get_sized_glyph_height()
The scaled bounding box height of the font in pixels get_sized_glyph_height(<size>=0) -> int Return the glyph bounding box height of the font in pixels. This is the average value of all glyphs in the font. It is not adjusted for strong or rotation. | pygame.ref.freetype#pygame.freetype.Font.get_sized_glyph_height |
get_sized_height()
The scaled height of the font in pixels get_sized_height(<size>=0) -> int Returns the height of the font. This is the average value of all glyphs in the font. It is not adjusted for strong or rotation. | pygame.ref.freetype#pygame.freetype.Font.get_sized_height |
get_sizes()
return the available sizes of embedded bitmaps get_sizes() -> [(int, int, int, float, float), ...] get_sizes() -> [] Returns a list of tuple records, one for each point size supported. Each tuple containing the point size, the height in pixels, width in pixels, horizontal ppem (nominal width) in fraction... | pygame.ref.freetype#pygame.freetype.Font.get_sizes |
height
The unscaled height of the font in font units height -> int Read only. Gets the height of the font. This is the average value of all glyphs in the font. | pygame.ref.freetype#pygame.freetype.Font.height |
kerning
Character kerning mode kerning -> bool Gets or sets the font's kerning mode. This defaults to False on all fonts, which will be rendered without kerning. Set to True to add kerning between character pairs, if supported by the font, when positioning glyphs. | pygame.ref.freetype#pygame.freetype.Font.kerning |
name
Proper font name. name -> string Read only. Returns the real (long) name of the font, as recorded in the font file. | pygame.ref.freetype#pygame.freetype.Font.name |
oblique
The state of the font's oblique style flag oblique -> bool Gets or sets whether the font will be rendered as oblique. This default style value will be used for all text rendering and size calculations unless overridden specifically in a render or get_rect() call, via the style parameter. The oblique style is... | pygame.ref.freetype#pygame.freetype.Font.oblique |
origin
Font render to text origin mode origin -> bool If set True, render_to() and render_raw_to() will take the dest position to be that of the text origin, as opposed to the top-left corner of the bounding box. See get_rect() for details. | pygame.ref.freetype#pygame.freetype.Font.origin |
pad
padded boundary mode pad -> bool If set True, then the text boundary rectangle will be inflated to match that of font.Font. Otherwise, the boundary rectangle is just large enough for the text. | pygame.ref.freetype#pygame.freetype.Font.pad |
path
Font file path path -> unicode Read only. Returns the path of the loaded font file | pygame.ref.freetype#pygame.freetype.Font.path |
render()
Return rendered text as a surface render(text, fgcolor=None, bgcolor=None, style=STYLE_DEFAULT, rotation=0, size=0) -> (Surface, Rect) Returns a new Surface, with the text rendered to it in the color given by 'fgcolor'. If no foreground color is given, the default foreground color, fgcolor is used. If bgcol... | pygame.ref.freetype#pygame.freetype.Font.render |
render_raw()
Return rendered text as a string of bytes render_raw(text, style=STYLE_DEFAULT, rotation=0, size=0, invert=False) -> (bytes, (int, int)) Like render() but with the pixels returned as a byte string of 8-bit gray-scale values. The foreground color is 255, the background 0, useful as an alpha mask for a fo... | pygame.ref.freetype#pygame.freetype.Font.render_raw |
render_raw_to()
Render text into an array of ints render_raw_to(array, text, dest=None, style=STYLE_DEFAULT, rotation=0, size=0, invert=False) -> Rect Render to an array object exposing an array struct interface. The array must be two dimensional with integer items. The default dest value, None, is equivalent to pos... | pygame.ref.freetype#pygame.freetype.Font.render_raw_to |
render_to()
Render text onto an existing surface render_to(surf, dest, text, fgcolor=None, bgcolor=None, style=STYLE_DEFAULT, rotation=0, size=0) -> Rect Renders the string text to the pygame.Surface surf, at position dest, a (x, y) surface coordinate pair. If either x or y is not an integer it is converted to one i... | pygame.ref.freetype#pygame.freetype.Font.render_to |
resolution
Pixel resolution in dots per inch resolution -> int Read only. Gets pixel size used in scaling font glyphs for this Font instance. | pygame.ref.freetype#pygame.freetype.Font.resolution |
rotation
text rotation in degrees counterclockwise rotation -> int Gets or sets the baseline angle of the rendered text. The angle is represented as integer degrees. The default angle is 0, with horizontal text rendered along the X-axis, and vertical text along the Y-axis. A positive value rotates these axes counter... | pygame.ref.freetype#pygame.freetype.Font.rotation |
scalable
Gets whether the font is scalable scalable -> bool Read only. Returns True if the font contains outline glyphs. If so, the point size is not limited to available bitmap sizes. | pygame.ref.freetype#pygame.freetype.Font.scalable |
size
The default point size used in rendering size -> float size -> (float, float) Get or set the default size for text metrics and rendering. It can be a single point size, given as a Python int or float, or a font ppem (width, height) tuple. Size values are non-negative. A zero size or width represents an undefine... | pygame.ref.freetype#pygame.freetype.Font.size |
strength
The strength associated with the strong or wide font styles strength -> float The amount by which a font glyph's size is enlarged for the strong or wide transformations, as a fraction of the untransformed size. For the wide style only the horizontal dimension is increased. For strong text both the horizonta... | pygame.ref.freetype#pygame.freetype.Font.strength |
strong
The state of the font's strong style flag strong -> bool Gets or sets whether the font will be bold when drawing text. This default style value will be used for all text rendering and size calculations unless overridden specifically in a render or get_rect() call, via the 'style' parameter. | pygame.ref.freetype#pygame.freetype.Font.strong |
style
The font's style flags style -> int Gets or sets the default style of the Font. This default style will be used for all text rendering and size calculations unless overridden specifically a render or get_rect() call. The style value may be a bit-wise OR of one or more of the following constants: STYLE_NORMAL
S... | pygame.ref.freetype#pygame.freetype.Font.style |
ucs4
Enable UCS-4 mode ucs4 -> bool Gets or sets the decoding of Unicode text. By default, the freetype module performs UTF-16 surrogate pair decoding on Unicode text. This allows 32-bit escape sequences ('Uxxxxxxxx') between 0x10000 and 0x10FFFF to represent their corresponding UTF-32 code points on Python interpre... | pygame.ref.freetype#pygame.freetype.Font.ucs4 |
underline
The state of the font's underline style flag underline -> bool Gets or sets whether the font will be underlined when drawing text. This default style value will be used for all text rendering and size calculations unless overridden specifically in a render or get_rect() call, via the 'style' parameter. | pygame.ref.freetype#pygame.freetype.Font.underline |
underline_adjustment
Adjustment factor for the underline position underline_adjustment -> float Gets or sets a factor which, when positive, is multiplied with the font's underline offset to adjust the underline position. A negative value turns an underline into a strike-through or overline. It is multiplied with the... | pygame.ref.freetype#pygame.freetype.Font.underline_adjustment |
use_bitmap_strikes
allow the use of embedded bitmaps in an outline font file use_bitmap_strikes -> bool Some scalable fonts include embedded bitmaps for particular point sizes. This property controls whether or not those bitmap strikes are used. Set it False to disable the loading of any bitmap strike. Set it True, ... | pygame.ref.freetype#pygame.freetype.Font.use_bitmap_strikes |
vertical
Font vertical mode vertical -> bool Gets or sets whether the characters are laid out vertically rather than horizontally. May be useful when rendering Kanji or some other vertical script. Set to True to switch to a vertical text layout. The default is False, place horizontally. Note that the Font class does... | pygame.ref.freetype#pygame.freetype.Font.vertical |
wide
The state of the font's wide style flag wide -> bool Gets or sets whether the font will be stretched horizontally when drawing text. It produces a result similar to pygame.font.Font's bold. This style not available for rotated text. | pygame.ref.freetype#pygame.freetype.Font.wide |
pygame.freetype.get_cache_size()
Return the glyph case size get_cache_size() -> long See pygame.freetype.init(). | pygame.ref.freetype#pygame.freetype.get_cache_size |
pygame.freetype.get_default_font()
Get the filename of the default font get_default_font() -> string Return the filename of the default pygame font. This is not the full path to the file. The file is usually in the same directory as the font module, but can also be bundled in a separate archive. | pygame.ref.freetype#pygame.freetype.get_default_font |
pygame.freetype.get_default_resolution()
Return the default pixel size in dots per inch get_default_resolution() -> long Returns the default pixel size, in dots per inch, for the module. The default is 72 DPI. | pygame.ref.freetype#pygame.freetype.get_default_resolution |
pygame.freetype.get_error()
Return the latest FreeType error get_error() -> str get_error() -> None Return a description of the last error which occurred in the FreeType2 library, or None if no errors have occurred. | pygame.ref.freetype#pygame.freetype.get_error |
pygame.freetype.get_init()
Returns True if the FreeType module is currently initialized. get_init() -> bool Returns True if the pygame.freetype module is currently initialized. New in pygame 1.9.5. | pygame.ref.freetype#pygame.freetype.get_init |
pygame.freetype.get_version()
Return the FreeType version get_version() -> (int, int, int) Returns the version of the FreeType library in use by this module. Note that the freetype module depends on the FreeType 2 library. It will not compile with the original FreeType 1.0. Hence, the first element of the tuple will... | pygame.ref.freetype#pygame.freetype.get_version |
pygame.freetype.init()
Initialize the underlying FreeType library. init(cache_size=64, resolution=72) This function initializes the underlying FreeType library and must be called before trying to use any of the functionality of the freetype module. However, pygame.init() will automatically call this function if the ... | pygame.ref.freetype#pygame.freetype.init |
pygame.freetype.quit()
Shut down the underlying FreeType library. quit() This function closes the freetype module. After calling this function, you should not invoke any class, method or function related to the freetype module as they are likely to fail or might give unpredictable results. It is safe to call this fu... | pygame.ref.freetype#pygame.freetype.quit |
pygame.freetype.set_default_resolution()
Set the default pixel size in dots per inch for the module set_default_resolution([resolution]) Set the default pixel size, in dots per inch, for the module. If the optional argument is omitted or zero the resolution is reset to 72 DPI. | pygame.ref.freetype#pygame.freetype.set_default_resolution |
pygame.freetype.SysFont()
create a Font object from the system fonts SysFont(name, size, bold=False, italic=False) -> Font Return a new Font object that is loaded from the system fonts. The font will match the requested bold and italic flags. Pygame uses a small set of common font aliases. If the specific font you a... | pygame.ref.freetype#pygame.freetype.SysFont |
pygame.freetype.was_init()
DEPRECATED: Use get_init() instead. was_init() -> bool DEPRECATED: Returns True if the pygame.freetype module is currently initialized. Use get_init() instead. | pygame.ref.freetype#pygame.freetype.was_init |
pygame.get_error()
get the current error message get_error() -> errorstr SDL maintains an internal error message. This message will usually be given to you when pygame.error() is raised, so this function will rarely be needed. | pygame.ref.pygame#pygame.get_error |
pygame.get_init()
returns True if pygame is currently initialized get_init() -> bool Returns True if pygame is currently initialized. New in pygame 1.9.5. | pygame.ref.pygame#pygame.get_init |
pygame.get_sdl_byteorder()
get the byte order of SDL get_sdl_byteorder() -> int Returns the byte order of the SDL library. It returns 1234 for little endian byte order and 4321 for big endian byte order. New in pygame 1.8. | pygame.ref.pygame#pygame.get_sdl_byteorder |
pygame.get_sdl_version()
get the version number of SDL get_sdl_version() -> major, minor, patch Returns the three version numbers of the SDL library. This version is built at compile time. It can be used to detect which features may or may not be available through pygame. New in pygame 1.7.0. | pygame.ref.pygame#pygame.get_sdl_version |
pygame.gfxdraw
pygame module for drawing shapes EXPERIMENTAL!: This API may change or disappear in later pygame releases. If you use this, your code may break with the next pygame release. The pygame package does not import gfxdraw automatically when loaded, so it must imported explicitly to be used. import pygame... | pygame.ref.gfxdraw |
pygame.gfxdraw.aacircle()
draw an antialiased circle aacircle(surface, x, y, r, color) -> None Draws an unfilled antialiased circle on the given surface.
Parameters:
surface (Surface) -- surface to draw on
x (int) -- x coordinate of the center of the circle
y (int) -- y coordinate of the center of the circ... | pygame.ref.gfxdraw#pygame.gfxdraw.aacircle |
pygame.gfxdraw.aaellipse()
draw an antialiased ellipse aaellipse(surface, x, y, rx, ry, color) -> None Draws an unfilled antialiased ellipse on the given surface.
Parameters:
surface (Surface) -- surface to draw on
x (int) -- x coordinate of the center of the ellipse
y (int) -- y coordinate of the center o... | pygame.ref.gfxdraw#pygame.gfxdraw.aaellipse |
pygame.gfxdraw.aapolygon()
draw an antialiased polygon aapolygon(surface, points, color) -> None Draws an unfilled antialiased polygon on the given surface. The adjacent coordinates in the points argument, as well as the first and last points, will be connected by line segments. e.g. For the points [(x1, y1), (x2, y... | pygame.ref.gfxdraw#pygame.gfxdraw.aapolygon |
pygame.gfxdraw.aatrigon()
draw an antialiased trigon/triangle aatrigon(surface, x1, y1, x2, y2, x3, y3, color) -> None Draws an unfilled antialiased trigon (triangle) on the given surface. An aatrigon can also be drawn using aapolygon() e.g. aapolygon(surface, ((x1, y1), (x2, y2), (x3, y3)), color)
Parameters:
... | pygame.ref.gfxdraw#pygame.gfxdraw.aatrigon |
pygame.gfxdraw.arc()
draw an arc arc(surface, x, y, r, start_angle, stop_angle, color) -> None Draws an arc on the given surface. For an arc with its endpoints connected to its center use pie(). The two angle arguments are given in degrees and indicate the start and stop positions of the arc. The arc is drawn in a c... | pygame.ref.gfxdraw#pygame.gfxdraw.arc |
pygame.gfxdraw.bezier()
draw a Bezier curve bezier(surface, points, steps, color) -> None Draws a Bézier curve on the given surface.
Parameters:
surface (Surface) -- surface to draw on
points (tuple(coordinate) or list(coordinate)) -- a sequence of 3 or more (x, y) coordinates used to form a curve, where ea... | pygame.ref.gfxdraw#pygame.gfxdraw.bezier |
pygame.gfxdraw.box()
draw a filled rectangle box(surface, rect, color) -> None Draws a filled rectangle on the given surface. For an unfilled rectangle use rectangle().
Parameters:
surface (Surface) -- surface to draw on
rect (Rect) -- rectangle to draw, position and dimensions
color (Color or tuple(int, i... | pygame.ref.gfxdraw#pygame.gfxdraw.box |
pygame.gfxdraw.circle()
draw a circle circle(surface, x, y, r, color) -> None Draws an unfilled circle on the given surface. For a filled circle use filled_circle().
Parameters:
surface (Surface) -- surface to draw on
x (int) -- x coordinate of the center of the circle
y (int) -- y coordinate of the center... | pygame.ref.gfxdraw#pygame.gfxdraw.circle |
pygame.gfxdraw.ellipse()
draw an ellipse ellipse(surface, x, y, rx, ry, color) -> None Draws an unfilled ellipse on the given surface. For a filled ellipse use filled_ellipse().
Parameters:
surface (Surface) -- surface to draw on
x (int) -- x coordinate of the center of the ellipse
y (int) -- y coordinate ... | pygame.ref.gfxdraw#pygame.gfxdraw.ellipse |
pygame.gfxdraw.filled_circle()
draw a filled circle filled_circle(surface, x, y, r, color) -> None Draws a filled circle on the given surface. For an unfilled circle use circle().
Parameters:
surface (Surface) -- surface to draw on
x (int) -- x coordinate of the center of the circle
y (int) -- y coordinate... | pygame.ref.gfxdraw#pygame.gfxdraw.filled_circle |
pygame.gfxdraw.filled_ellipse()
draw a filled ellipse filled_ellipse(surface, x, y, rx, ry, color) -> None Draws a filled ellipse on the given surface. For an unfilled ellipse use ellipse().
Parameters:
surface (Surface) -- surface to draw on
x (int) -- x coordinate of the center of the ellipse
y (int) -- ... | pygame.ref.gfxdraw#pygame.gfxdraw.filled_ellipse |
pygame.gfxdraw.filled_polygon()
draw a filled polygon filled_polygon(surface, points, color) -> None Draws a filled polygon on the given surface. For an unfilled polygon use polygon(). The adjacent coordinates in the points argument, as well as the first and last points, will be connected by line segments. e.g. For ... | pygame.ref.gfxdraw#pygame.gfxdraw.filled_polygon |
pygame.gfxdraw.filled_trigon()
draw a filled trigon/triangle filled_trigon(surface, x1, y1, x2, y2, x3, y3, color) -> None Draws a filled trigon (triangle) on the given surface. For an unfilled trigon use trigon(). A filled_trigon can also be drawn using filled_polygon() e.g. filled_polygon(surface, ((x1, y1), (x2, ... | pygame.ref.gfxdraw#pygame.gfxdraw.filled_trigon |
pygame.gfxdraw.hline()
draw a horizontal line hline(surface, x1, x2, y, color) -> None Draws a straight horizontal line ((x1, y) to (x2, y)) on the given surface. There are no endcaps.
Parameters:
surface (Surface) -- surface to draw on
x1 (int) -- x coordinate of one end of the line
x2 (int) -- x coordina... | pygame.ref.gfxdraw#pygame.gfxdraw.hline |
pygame.gfxdraw.line()
draw a line line(surface, x1, y1, x2, y2, color) -> None Draws a straight line ((x1, y1) to (x2, y2)) on the given surface. There are no endcaps.
Parameters:
surface (Surface) -- surface to draw on
x1 (int) -- x coordinate of one end of the line
y1 (int) -- y coordinate of one end of ... | pygame.ref.gfxdraw#pygame.gfxdraw.line |
pygame.gfxdraw.pie()
draw a pie pie(surface, x, y, r, start_angle, stop_angle, color) -> None Draws an unfilled pie on the given surface. A pie is an arc() with its endpoints connected to its center. The two angle arguments are given in degrees and indicate the start and stop positions of the pie. The pie is drawn i... | pygame.ref.gfxdraw#pygame.gfxdraw.pie |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.