The functions in this module can be used within the scene.Scene.draw() method when using the classic render loop mode of the scene module.
Set the blend mode for following drawing operations. mode can be BLEND_NORMAL, BLEND_ADD or BLEND_MULTIPLY.
Set the current stroke color.
Disables filling rectangles and ellipses. Combined with stroke_weight() and stroke() (to set the color), this allows you to draw shape outlines. Alternatively, you can set a transparent fill color with fill(0, 0, 0, 0).
Disables the drawing of borders around rectangles and ellipses.
Disables tinting images. Equivalent to tint(1, 1, 1, 1).
Set the current stroke color.
Fill the background of the current scene with a solid color.
Draw an ellipse in a rectangle with the current settings for fill color, stroke color and stroke width.
Draw a named image into a rectangle.
If the w(idth) and h(eight) parameters are omitted, the image is drawn at the full size with the origin at (x, y). Using the optional from_x, from_y, from_w, and from_h parameters, you can draw a rectangular portion of the image instead of the whole image.
Draw a named image into a quad.
The corners of the quad that the image is drawn into is given by the first set of xn/yn values. The from_xn/from_yn values can optionally be used to draw a quadrangular portion of the image instead of the whole image.
Draw a rectangle with the current settings for fill color, stroke color and stroke width.
Draw a string at a given point with a given font. The alignment parameter has 9 possible values that correspond to the positions on a numeric keypad (with 1 in the bottom lefthand corner). The default (5) centers the text on the point.
The color of the text can be set by calling the tint() function.
Set the current tint color that is used for drawing images and text.
A white tint color is the default and causes images to be drawn in their natural colors. Setting a white color (r = g = b = 1.0) with an alpha value < 1.0 makes the image translucent.
Draw a triangle strip with the given points (a list of 2-tuples), using the current fill color or an image. If an image is used, the tex_coords list should be a list of UV coordinates (of the same length as points).
Translates the current transformation matrix.
Rotate the current transformation matrix. The angle is in degrees.
Scale the current transformation matrix
Loads the named image. This can be used to improve performance, e.g. by loading all images that are about to be used in the setup() method of your Scene.
Load the image at the given file path and return a name that can be used with the image() drawing function.
Only images using the ‘RGBA’ mode are supported at the moment.
Render a string of text as an image name (that can be used with the image() function). Returns a tuple of the name and a Size object.
This can be used to determine the size of a string before drawing it, or to repeatedly draw the same text slightly more efficiently.