Primitives
- arcade.draw_arc_filled(center_x: float, center_y: float, width: float, height: float, color: tuple[int, int, int] | tuple[int, int, int, int], start_angle: float, end_angle: float, tilt_angle: float = 0, num_segments: int = 128) None [source]
Draw a filled in arc. Useful for drawing pie-wedges, or Pac-Man.
- Parameters:
center_x – x position that is the center of the arc.
center_y – y position that is the center of the arc.
width – width of the arc.
height – height of the arc.
color – A 3 or 4 length tuple of 0-255 channel values or a
Color
instance.start_angle – start angle of the arc in degrees.
end_angle – end angle of the arc in degrees.
tilt_angle – angle the arc is tilted (clockwise).
num_segments – Number of line segments used to draw arc.
- arcade.draw_arc_outline(center_x: float, center_y: float, width: float, height: float, color: tuple[int, int, int] | tuple[int, int, int, int], start_angle: float, end_angle: float, border_width: float = 1, tilt_angle: float = 0, num_segments: int = 128) None [source]
Draw the outside edge of an arc. Useful for drawing curved lines.
- Parameters:
center_x – x position that is the center of the arc.
center_y – y position that is the center of the arc.
width – width of the arc.
height – height of the arc.
color – A 3 or 4 length tuple of 0-255 channel values or a
Color
instance.start_angle – Start angle of the arc in degrees.
end_angle – End angle of the arc in degrees.
border_width – width of line in pixels.
tilt_angle – Angle the arc is tilted (clockwise).
num_segments – Number of triangle segments that make up this circle. Higher is better quality, but slower render time.
- arcade.draw_circle_filled(center_x: float, center_y: float, radius: float, color: tuple[int, int, int] | tuple[int, int, int, int], tilt_angle: float = 0, num_segments: int = -1) None [source]
Draw a filled-in circle.
- Parameters:
center_x – x position that is the center of the circle.
center_y – y position that is the center of the circle.
radius – width of the circle.
color – A 3 or 4 length tuple of 0-255 channel values or a
Color
instance.tilt_angle – Angle in degrees to tilt the circle. Useful for low segment count circles
num_segments – Number of triangle segments that make up this circle. Higher is better quality, but slower render time. The default value of -1 means Arcade will try to calculate a reasonable amount of segments based on the size of the circle.
- arcade.draw_circle_outline(center_x: float, center_y: float, radius: float, color: tuple[int, int, int] | tuple[int, int, int, int], border_width: float = 1, tilt_angle: float = 0, num_segments: int = -1) None [source]
Draw the outline of a circle.
- Parameters:
center_x – x position that is the center of the circle.
center_y – y position that is the center of the circle.
radius – width of the circle.
color – A 3 or 4 length tuple of 0-255 channel values or a
Color
instance.border_width – Width of the circle outline in pixels.
tilt_angle – Angle in degrees to tilt the circle (clockwise). Useful for low segment count circles
num_segments – Number of triangle segments that make up this circle. Higher is better quality, but slower render time. The default value of -1 means Arcade will try to calculate a reasonable amount of segments based on the size of the circle.
- arcade.draw_ellipse_filled(center_x: float, center_y: float, width: float, height: float, color: tuple[int, int, int] | tuple[int, int, int, int], tilt_angle: float = 0, num_segments: int = -1) None [source]
Draw a filled in ellipse.
- Parameters:
center_x – x position that is the center of the circle.
center_y – y position that is the center of the circle.
width – width of the ellipse.
height – height of the ellipse.
color – A 3 or 4 length tuple of 0-255 channel values or a
Color
instance.color – Either a
Color
instance or an RGBAtuple
of 4 byte values (0 to 255).tilt_angle – Angle in degrees to tilt the ellipse (clockwise). Useful when drawing a circle with a low segment count, to make an octagon for example.
num_segments – Number of triangle segments that make up this circle. Higher is better quality, but slower render time. The default value of -1 means Arcade will try to calculate a reasonable amount of segments based on the size of the circle.
- arcade.draw_ellipse_outline(center_x: float, center_y: float, width: float, height: float, color: tuple[int, int, int] | tuple[int, int, int, int], border_width: float = 1, tilt_angle: float = 0, num_segments: int = -1) None [source]
Draw the outline of an ellipse.
- Parameters:
center_x – x position that is the center of the circle.
center_y – y position that is the center of the circle.
width – width of the ellipse.
height – height of the ellipse.
color – A 3 or 4 length tuple of 0-255 channel values or a
Color
instance.border_width – Width of the circle outline in pixels.
tilt_angle – Angle in degrees to tilt the ellipse (clockwise). Useful when drawing a circle with a low segment count, to make an octagon for example.
num_segments – Number of triangle segments that make up this circle. Higher is better quality, but slower render time. The default value of -1 means Arcade will try to calculate a reasonable amount of segments based on the size of the circle.
- arcade.get_points_for_thick_line(start_x: float, start_y: float, end_x: float, end_y: float, line_width: float) tuple[tuple[float | int, float | int] | Vec2, tuple[float | int, float | int] | Vec2, tuple[float | int, float | int] | Vec2, tuple[float | int, float | int] | Vec2] [source]
Function used internally for Arcade. OpenGL draws triangles only, so a thick line must be two triangles that make up a rectangle. This calculates and returns those points.
- arcade.draw_line_strip(point_list: Sequence[tuple[float | int, float | int] | Vec2], color: tuple[int, int, int] | tuple[int, int, int, int], line_width: float = 1) None [source]
Draw a multi-point line.
- Parameters:
point_list – List of x, y points that make up this strip
color – A color, specified as an RGBA tuple or a
Color
instance.line_width – Width of the line
- arcade.draw_line(start_x: float, start_y: float, end_x: float, end_y: float, color: tuple[int, int, int] | tuple[int, int, int, int], line_width: float = 1) None [source]
Draw a line.
- Parameters:
start_x – x position of line starting point.
start_y – y position of line starting point.
end_x – x position of line ending point.
end_y – y position of line ending point.
color – A color, specified as an RGBA tuple or a
Color
instance.line_width – Width of the line in pixels.
- arcade.draw_lines(point_list: Sequence[tuple[float | int, float | int] | Vec2], color: tuple[int, int, int] | tuple[int, int, int, int], line_width: float = 1) None [source]
Draw a set of lines.
Draw a line between each pair of points specified.
- Parameters:
point_list – List of points making up the lines. Each point is in a list. So it is a list of lists.
color – A color, specified as an RGBA tuple or a
Color
instance.line_width – Width of the line in pixels.
- arcade.draw_parabola_filled(start_x: float, start_y: float, end_x: float, height: float, color: tuple[int, int, int] | tuple[int, int, int, int], tilt_angle: float = 0) None [source]
Draws a filled in parabola.
- Parameters:
start_x – The starting x position of the parabola
start_y – The starting y position of the parabola
end_x – The ending x position of the parabola
height – The height of the parabola
color – A 3 or 4 length tuple of 0-255 channel values or a
Color
instance.tilt_angle – The angle of the tilt of the parabola (clockwise)
- arcade.draw_parabola_outline(start_x: float, start_y: float, end_x: float, height: float, color: tuple[int, int, int] | tuple[int, int, int, int], border_width: float = 1, tilt_angle: float = 0) None [source]
Draws the outline of a parabola.
- Parameters:
start_x – The starting x position of the parabola
start_y – The starting y position of the parabola
end_x – The ending x position of the parabola
height – The height of the parabola
color – A 3 or 4 length tuple of 0-255 channel values or a
Color
instance.border_width – The width of the parabola
tilt_angle – The angle of the tilt of the parabola (clockwise)
- arcade.draw_point(x: float, y: float, color: tuple[int, int, int] | tuple[int, int, int, int], size: float = 1.0) None [source]
Draw a 2D point at
(x, y)
as a squaresize
pixels wide.The square will be centered on
(x, y)
with the givencolor
as its fill value.To draw more rounded shapes, please see:
arcade.draw.circle.draw_circle_filled()
pyglet.shapes.Circle()
- arcade.draw_points(point_list: Sequence[tuple[float | int, float | int] | Vec2], color: tuple[int, int, int] | tuple[int, int, int, int], size: float = 1.0) None [source]
Draw 2D points as squares
size
pixels wide.Each point in
point_list
will be drawn centered on its x and y value with the samecolor
and squaresize
in pixels.To draw more rounded shapes, please see:
arcade.draw.circle.draw_circle_filled()
pyglet.shapes.Circle()
- arcade.draw_polygon_filled(point_list: Sequence[tuple[float | int, float | int] | Vec2], color: tuple[int, int, int] | tuple[int, int, int, int]) None [source]
Draw a polygon that is filled in.
- Parameters:
point_list – List of points making up the lines. Each point is in a list. So it is a list of lists.
color – The color, specified in RGB or RGBA format.
- arcade.draw_polygon_outline(point_list: Sequence[tuple[float | int, float | int] | Vec2], color: tuple[int, int, int] | tuple[int, int, int, int], line_width: float = 1.0) None [source]
Draw a polygon outline. Also known as a “line loop.”
- arcade.draw_texture_rect(texture: Texture, rect: Rect, *, color: Color = (255, 255, 255, 255), angle=0.0, blend=True, alpha=255, pixelated=False, atlas: TextureAtlasBase | None = None) None [source]
Draw a texture on a rectangle.
- Parameters:
texture – The texture to draw.
rect – Rectangle to draw the texture on.
color – Color multiplier for the texture. Defaults to white.
angle – Rotation of the texture in degrees. Defaults to zero.
blend – If True, enable alpha blending. Defaults to True.
alpha – Transparency of image. 0 is fully transparent, 255 (default) is fully opaque.
atlas – The texture atlas the texture resides in. if not supplied the default texture atlas is used
- arcade.draw_sprite(sprite: BasicSprite, *, blend: bool = True, alpha=255, pixelated=False, atlas: TextureAtlasBase | None = None) None [source]
Draw a sprite.
- Parameters:
sprite – The sprite to draw.
blend – Draw the sprite with or without alpha blending
alpha – Fade the sprite from completely transparent to opaque (range: 0 to 255)
pixelated – If true the sprite will be render in pixelated style. Otherwise smooth/linear
atlas – The texture atlas the texture resides in. if not supplied the default texture atlas is used
- arcade.draw_sprite_rect(sprite: BasicSprite, rect: Rect, *, blend: bool = True, alpha=255, pixelated=False, atlas: TextureAtlasBase | None = None) None [source]
Draw a sprite.
- Parameters:
sprite – The sprite to draw.
rect – The location and size of the sprite
blend – Draw the sprite with or without alpha blending
alpha – Fade the sprite from completely transparent to opaque (range: 0 to 255)
pixelated – If true the sprite will be render in pixelated style. Otherwise smooth/linear
atlas – The texture atlas the texture resides in. if not supplied the default texture atlas is used
- arcade.draw_lrbt_rectangle_outline(left: float, right: float, bottom: float, top: float, color: tuple[int, int, int] | tuple[int, int, int, int], border_width: float = 1) None [source]
Draw a rectangle by specifying left, right, bottom and top edges.
- Parameters:
left – The x coordinate of the left edge of the rectangle.
right – The x coordinate of the right edge of the rectangle.
bottom – The y coordinate of the rectangle bottom.
top – The y coordinate of the top of the rectangle.
color – The outline color as an RGBA
tuple
, RGBtuple
, or aColor
instance.border_width – The width of the border in pixels. Defaults to one.
- Raises:
ValueError – Raised if left > right or top < bottom.
- arcade.draw_lbwh_rectangle_outline(left: float, bottom: float, width: float, height: float, color: tuple[int, int, int] | tuple[int, int, int, int], border_width: float = 1) None [source]
Draw a rectangle extending from bottom left to top right
- Parameters:
bottom_left_x – The x coordinate of the left edge of the rectangle.
bottom_left_y – The y coordinate of the bottom of the rectangle.
width – The width of the rectangle.
height – The height of the rectangle.
color – The outline color as an RGBA
tuple
, RGBtuple
, or aColor
instance.border_width – The width of the border in pixels. Defaults to one.
- arcade.draw_lrbt_rectangle_filled(left: float, right: float, bottom: float, top: float, color: tuple[int, int, int] | tuple[int, int, int, int]) None [source]
Draw a rectangle by specifying left, right, bottom and top edges.
- Parameters:
- Raises:
ValueError – Raised if left > right or top < bottom.
- arcade.draw_lbwh_rectangle_filled(left: float, bottom: float, width: float, height: float, color: tuple[int, int, int] | tuple[int, int, int, int]) None [source]
Draw a filled rectangle extending from bottom left to top right
- arcade.draw_rect_outline(rect: Rect, color: tuple[int, int, int] | tuple[int, int, int, int], border_width: float = 1, tilt_angle: float = 0) None [source]
Draw a rectangle outline.
- arcade.draw_rect_filled(rect: Rect, color: tuple[int, int, int] | tuple[int, int, int, int], tilt_angle: float = 0) None [source]
Draw a filled-in rectangle.
- arcade.draw_triangle_filled(x1: float, y1: float, x2: float, y2: float, x3: float, y3: float, color: tuple[int, int, int] | tuple[int, int, int, int]) None [source]
Draw a filled in triangle.
- arcade.draw_triangle_outline(x1: float, y1: float, x2: float, y2: float, x3: float, y3: float, color: tuple[int, int, int] | tuple[int, int, int, int], border_width: float = 1) None [source]
Draw a the outline of a triangle.
- Parameters:
x1 – x value of first coordinate.
y1 – y value of first coordinate.
x2 – x value of second coordinate.
y2 – y value of second coordinate.
x3 – x value of third coordinate.
y3 – y value of third coordinate.
color – RGBOrA255 of triangle as an RGBA
tuple
orColor
instance.border_width – Width of the border in pixels. Defaults to 1.