APIDrawingOverview

Drawing

Drawing calls render into the current frame between begin_drawing() and end_drawing(). Later calls appear on top of earlier calls.

Rectangles

  • draw_rectangle(x: int, y: int, width: int, height: int, color: Color) -> None
  • draw_rectangle_lines(x: int, y: int, width: int, height: int, color: Color) -> None
  • draw_rectangle_rounded(x: int, y: int, width: int, height: int, roundness: float, color: Color) -> None
  • draw_rectangle_gradient(x: int, y: int, width: int, height: int, top_color: Color, bottom_color: Color) -> None

Circles, lines, polygons, text, and pixels

  • draw_circle(x: float, y: float, radius: float, color: Color) -> None
  • draw_circle_lines(x: int, y: int, radius: float, color: Color) -> None
  • draw_ellipse(x: int, y: int, radius_x: float, radius_y: float, color: Color) -> None
  • draw_ellipse_lines(x: int, y: int, radius_x: float, radius_y: float, color: Color) -> None
  • draw_line(start_x: int, start_y: int, end_x: int, end_y: int, color: Color) -> None
  • draw_line_ex(start_x: int, start_y: int, end_x: int, end_y: int, thick: float, color: Color) -> None
  • draw_triangle(v1_x: int, v1_y: int, v2_x: int, v2_y: int, v3_x: int, v3_y: int, color: Color) -> None
  • draw_triangle_lines(v1_x: int, v1_y: int, v2_x: int, v2_y: int, v3_x: int, v3_y: int, color: Color) -> None
  • draw_polygon(center_x: int, center_y: int, sides: int, radius: float, rotation: float, color: Color) -> None
  • draw_text(text: str, x: int, y: int, font_size: int, color: Color) -> None
  • measure_text(text: str, font_size: int) -> int
  • draw_pixel(x: int, y: int, color: Color) -> None
from conjure import *
 
init_window(360, 640, "Drawing")
 
while not window_should_close():
    begin_drawing()
    clear_background(WHITE)
    draw_rectangle(40, 80, 120, 80, BLUE)
    draw_circle(240, 120, 36, RED)
    draw_line(40, 220, 320, 220, BLACK)
    end_drawing()

Next, pair drawing with input or continue to colors.