@@ -807,13 +807,25 @@ impl Graphics {
807807 . map_err ( |e| PyRuntimeError :: new_err ( format ! ( "{e}" ) ) )
808808 }
809809
810+ /// Loads an image from a file and returns an Image object.
811+ ///
812+ /// The path is relative to the sketch's assets directory.
810813 pub fn load_image ( & self , file : & str ) -> PyResult < Image > {
811814 match image_load ( file) {
812815 Ok ( image) => Ok ( Image { entity : image } ) ,
813816 Err ( e) => Err ( PyRuntimeError :: new_err ( format ! ( "{e}" ) ) ) ,
814817 }
815818 }
816819
820+ /// Draws an image to the screen.
821+ ///
822+ /// Optional `d_width` and `d_height` resize the image on screen. If omitted,
823+ /// the image's original dimensions are used.
824+ ///
825+ /// Optional `sx`, `sy`, `s_width`, and `s_height` define a sub-region
826+ /// of the source image to draw, specified in pixels.
827+ ///
828+ /// Affected by `image_mode()`, `tint()`, and the current transform.
817829 #[ pyo3( signature = ( source, dx, dy, d_width=None , d_height=None , sx=None , sy=None , s_width=None , s_height=None ) ) ]
818830 pub fn image (
819831 & self ,
@@ -844,6 +856,10 @@ impl Graphics {
844856 . map_err ( |e| PyRuntimeError :: new_err ( format ! ( "{e}" ) ) )
845857 }
846858
859+ /// Sets a tint color applied when drawing images.
860+ ///
861+ /// Accepts the same color arguments as `fill()`. The tint is multiplied
862+ /// with the image's pixel colors. Use `no_tint()` to remove.
847863 #[ pyo3( signature = ( * args) ) ]
848864 pub fn tint ( & self , args : & Bound < ' _ , PyTuple > ) -> PyResult < ( ) > {
849865 let color = extract_color_with_mode (
@@ -855,11 +871,17 @@ impl Graphics {
855871 . map_err ( |e| PyRuntimeError :: new_err ( format ! ( "{e}" ) ) )
856872 }
857873
874+ /// Removes the current tint color so images draw without color modification.
858875 pub fn no_tint ( & self ) -> PyResult < ( ) > {
859876 graphics_record_command ( self . entity , DrawCommand :: NoTint )
860877 . map_err ( |e| PyRuntimeError :: new_err ( format ! ( "{e}" ) ) )
861878 }
862879
880+ /// Changes how image position arguments are interpreted.
881+ ///
882+ /// - `CORNER` (default) — `dx`, `dy` is the top-left corner.
883+ /// - `CORNERS` — `dx`, `dy` and `d_width`, `d_height` are opposite corners.
884+ /// - `CENTER` — `dx`, `dy` is the center of the image.
863885 pub fn image_mode ( & self , mode : u8 ) -> PyResult < ( ) > {
864886 graphics_record_command (
865887 self . entity ,
0 commit comments