pygame2.sdlgfx.primitives – SDL_gfx primitives drawing module

SDL_gfx primitives drawing module

Module Functions

pygame2.sdlgfx.primitives.aacircle(surface, x, y, radius, color) → None
pygame2.sdlgfx.primitives.aacircle(surface, point, radius, color) → None

Draws an anti-aliased circular shape on a surface.

Draws a anti-aliased circular shape on a surface with a fixed line width of 1px. The x, y point denotes the center of the circle.

pygame2.sdlgfx.primitives.aaellipse(surface, x, y, rx, ry, color) → None
pygame2.sdlgfx.primitives.aaellipse(surface, point, radius, color) → None

Draws an anti-aliased elliptical shape on a surface.

Draws an anti-aliased elliptical shape on a surface with a fixed line width of 1px. The x, y tuple denotes the center of the ellipse, rx, ry the radius for the x- and y-axis.

pygame2.sdlgfx.primitives.aapolygon(surface, (point1, point2, ...), color) → None

Draws an anti-aliased polygonal shape on a surface.

Draws an anti-aliased polygonal shape on a surface with an fixed line width of 1px.

pygame2.sdlgfx.primitives.aatrigon(surface, x1, y1, x2, y2, x3, y3, color) → None
pygame2.sdlgfx.primitives.aatrigon(surface, point1, point2, point3, color) → None

Draws an anti-aliased triangular shape on a surface.

Draws an anti-aliased triangular shape on a surface with an fixed line width of 1px. The three x, y points denote the edges of the triangle.

pygame2.sdlgfx.primitives.arc(surface, x, y, radius, startangle, stopangle, color) → None
pygame2.sdlgfx.primitives.arc(surface, point, radius, startangle, stopangle, color) → None

Draws an elliptical arc on a surface.

Draws an elliptical arc on a surface. The startangle and stopangle arguments are the initial and final angle in degrees.

pygame2.sdlgfx.primitives.bezier(surface, (point1, point2, ...), steps, color) → None

Draws a bezier curve on a surface.

Draws a bezier curve through the given points on a surface. steps denotes the amount of steps to perform for interpolating the curve.

pygame2.sdlgfx.primitives.box(surface, rect, color) → None

Draws a filled rectangular shape on a surface.

Draws a filled rectangular shape on a surface.

pygame2.sdlgfx.primitives.circle(surface, x, y, radius, color) → None
pygame2.sdlgfx.primitives.circle(surface, point, radius, color) → None

Draws a circular shape on a surface.

Draws a circular shape on a surface with a fixed line width of 1px. The x, y point denotes the center of the circle.

pygame2.sdlgfx.primitives.ellipse(surface, x, y, rx, ry, color) → None
pygame2.sdlgfx.primitives.ellipse(surface, point, radius, color) → None

Draws an elliptical shape on a surface.

Draws an elliptical shape on a surface with a fixed line width of 1px. The x, y point denotes the center of the ellipse, rx, ry the radius for the x- and y-axis.

pygame2.sdlgfx.primitives.filled_circle(surface, x, y, radius, color) → None
pygame2.sdlgfx.primitives.filled_circle(surface, point, radius, color) → None

Draws a filled circular shape on a surface.

Draws a filled circular shape on a surface. The x, y point denotes the center of the circle.

pygame2.sdlgfx.primitives.filled_ellipse(surface, x, y, rx, ry, color) → None
pygame2.sdlgfx.primitives.filled_ellipse(surface, point, radius, color) → None

Draws a filled elliptical shape on a surface.

Draws a filled elliptical shape on a surface. The x, y point denotes the center of the ellipse, rx, ry the radius for the x- and y-axis.

pygame2.sdlgfx.primitives.filled_pie(surface, x, y, r, startangle, stopangle, color) → None
pygame2.sdlgfx.primitives.filled_pie(surface, point, r, startangle, stopangle, color) → None

Draws a filled pie-like shape on a surface.

Draws a filled pie-like shape on a surface. The x, y point denotes the center of the pie segment, startangle and stopangle the initial and final angle in degrees.

pygame2.sdlgfx.primitives.filled_polygon(surface, (point1, point2, ...), color) → None

Draws a filled polygonal shape on a surface.

Draws a filled polygonal shape on a surface.

pygame2.sdlgfx.primitives.filled_trigon(surface, x1, y1, x2, y2, x3, y3, color) → None
pygame2.sdlgfx.primitives.filled_trigon(surface, point1, point2, point3, color) → None

Draws a filled triangular shape on a surface.

Draws a filled triangular shape on a surface. The three x, y points denote the edges of the triangle.

pygame2.sdlgfx.primitives.hline(surface, x1, x2, y, color) → None

Draws a horizontal line on a surface.

Draws a horizontal line on a surface with the fixed width of 1 px. x1 and x2 denote the start and end position on the x-axis, y the vertical position of the line on the y-axis.

pygame2.sdlgfx.primitives.line(surface, x1, y1, x2, y2, color) → None
pygame2.sdlgfx.primitives.line(surface, point1, point2, color) → None

Draws a line on a surface.

Draws a line on a surface with a fixed width of 1px. x1, y1 and x2, y2 denote the start and end position of the line.

pygame2.sdlgfx.primitives.pie(surface, x, y, r, startangle, stopangle, color) → None
pygame2.sdlgfx.primitives.pie(surface, point, r, startangle, stopangle, color) → None

Draws a pie-like shape on a surface.

Draws a pie-like shape on a surface with a fixed width of 1px. The x, y point denotes the center of the pie segment, startangle and stopangle the initial and final angle in degrees.

pygame2.sdlgfx.primitives.pixel(surface, x, y, color) → None
pygame2.sdlgfx.primitives.pixel(surface, point, color) → None

Draws a single pixel on a surface.

Draws a single pixel on a surface.

pygame2.sdlgfx.primitives.polygon(surface, ((x1, y1), (x2, y2), ...), color) → None

Draws a polygonal shape on a surface.

Draws a polygonal shape on a surface.

pygame2.sdlgfx.primitives.rectangle(surface, rect, color) → None

Draws a rectangular shape on a surface.

Draws a rectangular shape on a surface.

pygame2.sdlgfx.primitives.textured_polygon(surface, (point1, point2, ...), texture, tx, ty) → None
pygame2.sdlgfx.primitives.textured_polygon(surface, (point1, point2, ...), texture, tpoint) → None

Draws a textured polygonal shape on a surface.

Draws a textured polygonal shape on a surface. texture is a pygame2.sdl.video.Surface to be used for filling the shape, tx, ty are the offset of the texture relative to the screen.

pygame2.sdlgfx.primitives.trigon(surface, x1, y1, x2, y2, x3, y3, color) → None
pygame2.sdlgfx.primitives.trigon(surface, point1, point2, point3, color) → None

Draws a triangular shape on a surface.

Draws a filled triangular shape on a surface with a fixed line width of 1px. The three x, y points denote the edges of the triangle.

pygame2.sdlgfx.primitives.vline(surface, x, y1, y2, color) → None

Draws a vertical line on a surface.

Draws a vertical line on a surface with a fixed width of 1px. y1 and y2 denote the start and end position on the y-axis, x the horizontal position of the line on the x-axis.