Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion arcade/screenshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ def get_pixel(x: int, y: int, components: int = 3) -> tuple[int, ...]:
"""
Given an x, y, will return a color value of that point.

.. note:: Call this at the end of ``on_draw``, after drawing. Once a
frame has been shown, such as in ``on_key_press``, the
screen's contents are undefined and may read as black.

Args:
x: x location
y: y location
Expand Down Expand Up @@ -43,9 +47,13 @@ def get_image(
"""
Get an image from the screen.

.. note:: Call this at the end of ``on_draw``, after drawing. Once a
frame has been shown, such as in ``on_key_press``, the
screen's contents are undefined and may read as black.

Example::

# Create and image of the entire screen and save it to a file
# At the end of on_draw, save an image of the entire screen
image = arcade.get_image()
image.save('screenshot.png')

Expand Down
Loading