diff --git a/arcade/screenshot.py b/arcade/screenshot.py index 28b7a1b0d..ace2d2566 100644 --- a/arcade/screenshot.py +++ b/arcade/screenshot.py @@ -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 @@ -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')