APIDrawingdraw_line

draw_line

Draws a straight line segment.

Signature

draw_line

Draws a straight line segment.

Signature

draw_line(start_x: int, start_y: int, end_x: int, end_y: int, color: Color, thickness: int = 1) -> None

Parameters

NameTypeDefaultDescription
start_xintNonestart_x argument for this API call.
start_yintNonestart_y argument for this API call.
end_xintNoneend_x argument for this API call.
end_yintNoneend_y argument for this API call.
colorColorNonecolor argument for this API call.
thicknessint1thickness argument for this API call.

Returns

None

Example

from conjure import *

init_window(360, 640, "API")
while not window_should_close():
    begin_drawing()
    clear_background(WHITE)
    draw_text("Moosh", 120, 300, 28, BLACK)
    end_drawing()

See also

  • draw_circle
  • draw_rectangle
  • draw_text

Return to the drawing overview or continue with the quickstart.