|
56 | 56 | "draw_rectangle_filled", |
57 | 57 | "draw_scaled_texture_rectangle", |
58 | 58 | "draw_texture_rectangle", |
| 59 | + "draw_lbwh_rectangle_textured", |
59 | 60 | "draw_lrwh_rectangle_textured", |
60 | 61 | "get_pixel", |
61 | 62 | "get_image" |
@@ -961,11 +962,39 @@ def draw_texture_rectangle(center_x: float, center_y: float, |
961 | 962 | texture.draw_sized(center_x, center_y, width, height, angle, alpha) |
962 | 963 |
|
963 | 964 |
|
| 965 | +@warning( |
| 966 | + warning_type=ReplacementWarning, |
| 967 | + new_name="draw_lbwh_rectangle_textured" |
| 968 | +) |
964 | 969 | def draw_lrwh_rectangle_textured(bottom_left_x: float, bottom_left_y: float, |
965 | 970 | width: float, |
966 | 971 | height: float, |
967 | 972 | texture: Texture, angle: float = 0, |
968 | 973 | alpha: int = 255): |
| 974 | + """Draw a texture extending from bottom left to top right. |
| 975 | +
|
| 976 | + .. deprecated:: 3.0 |
| 977 | + Use :py:func:`draw_lbwh_rectangle_textured` instead! |
| 978 | +
|
| 979 | + :param bottom_left_x: The x coordinate of the left edge of the rectangle. |
| 980 | + :param bottom_left_y: The y coordinate of the bottom of the rectangle. |
| 981 | + :param width: The width of the rectangle. |
| 982 | + :param height: The height of the rectangle. |
| 983 | + :param texture: identifier of texture returned from load_texture() call |
| 984 | + :param angle: rotation of the rectangle. Defaults to zero (clockwise). |
| 985 | + :param alpha: Transparency of image. 0 is fully transparent, 255 (default) is visible |
| 986 | + """ |
| 987 | + |
| 988 | + center_x = bottom_left_x + (width / 2) |
| 989 | + center_y = bottom_left_y + (height / 2) |
| 990 | + texture.draw_sized(center_x, center_y, width, height, angle=angle, alpha=alpha) |
| 991 | + |
| 992 | + |
| 993 | +def draw_lbwh_rectangle_textured(bottom_left_x: float, bottom_left_y: float, |
| 994 | + width: float, |
| 995 | + height: float, |
| 996 | + texture: Texture, angle: float = 0, |
| 997 | + alpha: int = 255): |
969 | 998 | """ |
970 | 999 | Draw a texture extending from bottom left to top right. |
971 | 1000 |
|
|
0 commit comments