APIImagesdraw_image_rec

draw_image_rec

Draws a source rectangle from an image.

Signature

draw_image_rec

Draws a source rectangle from an image.

Signature

draw_image_rec(image: Image, source_rect: tuple[int, int, int, int], x: int, y: int, tint: Color = WHITE) -> None

Parameters

NameTypeDefaultDescription
imageImageNoneimage argument for this API call.
source_recttuple[int, int, int, int]Nonesource_rect argument for this API call.
xintNonex argument for this API call.
yintNoney argument for this API call.
tintColorWHITEtint argument for this API call.

Returns

None

Example

from conjure import *

init_window(360, 640, "Images")
sprite = load_image("player.png")
draw_image(sprite, 120, 220)

See also

  • load_image
  • unload_image
  • draw_image

Return to the images overview or continue with the quickstart.