|
1 | | -from typing import Optional, Protocol, Union, final |
| 1 | +from collections.abc import Iterable |
| 2 | +from typing import Any, Optional, Protocol, Union, final |
2 | 3 |
|
3 | 4 | from pygame.color import Color |
4 | 5 | from pygame.rect import Rect |
5 | 6 | from pygame.surface import Surface |
6 | 7 | from pygame.typing import ColorLike, IntPoint, Point, RectLike, SequenceLike |
7 | 8 | from pygame.window import Window |
8 | | -from typing_extensions import deprecated # added in 3.13 |
9 | 9 |
|
10 | 10 | class _DrawableClass(Protocol): |
11 | 11 | # Object that has the draw method that accepts area and dest arguments |
@@ -74,7 +74,74 @@ class Renderer: |
74 | 74 |
|
75 | 75 | @final |
76 | 76 | class Texture: |
77 | | - pass |
| 77 | + def __init__( |
| 78 | + self, |
| 79 | + renderer: Renderer, |
| 80 | + size: Iterable[int], |
| 81 | + depth: int = 0, |
| 82 | + static: bool = False, |
| 83 | + streaming: bool = False, |
| 84 | + target: bool = False, |
| 85 | + scale_quality: Optional[int] = None, |
| 86 | + ) -> None: ... |
| 87 | + @property |
| 88 | + def alpha(self) -> int: ... |
| 89 | + @alpha.setter |
| 90 | + def alpha(self, value: int) -> None: ... |
| 91 | + @property |
| 92 | + def blend_mode(self) -> int: ... |
| 93 | + @blend_mode.setter |
| 94 | + def blend_mode(self, value: int) -> None: ... |
| 95 | + @property |
| 96 | + def color(self) -> Color: ... |
| 97 | + @color.setter |
| 98 | + def color(self, value: ColorLike) -> None: ... |
| 99 | + @property |
| 100 | + def width(self) -> int: ... |
| 101 | + @property |
| 102 | + def height(self) -> int: ... |
| 103 | + @property |
| 104 | + def renderer(self) -> Renderer: ... |
| 105 | + @classmethod |
| 106 | + def from_surface(cls, renderer: Renderer, surface: Surface) -> Texture: ... |
| 107 | + def draw( |
| 108 | + self, |
| 109 | + srcrect: Optional[RectLike] = None, |
| 110 | + dstrect: Optional[RectLike] = None, |
| 111 | + angle: float = 0.0, |
| 112 | + origin: Optional[Iterable[int]] = None, |
| 113 | + flip_x: bool = False, |
| 114 | + flip_y: bool = False, |
| 115 | + ) -> None: ... |
| 116 | + def draw_triangle( |
| 117 | + self, |
| 118 | + p1_xy: Point, |
| 119 | + p2_xy: Point, |
| 120 | + p3_xy: Point, |
| 121 | + p1_uv: Point = (0.0, 0.0), |
| 122 | + p2_uv: Point = (1.0, 1.0), |
| 123 | + p3_uv: Point = (0.0, 1.0), |
| 124 | + p1_mod: ColorLike = (255, 255, 255, 255), |
| 125 | + p2_mod: ColorLike = (255, 255, 255, 255), |
| 126 | + p3_mod: ColorLike = (255, 255, 255, 255), |
| 127 | + ) -> None: ... |
| 128 | + def draw_quad( |
| 129 | + self, |
| 130 | + p1_xy: Point, |
| 131 | + p2_xy: Point, |
| 132 | + p3_xy: Point, |
| 133 | + p4_xy: Point, |
| 134 | + p1_uv: Point = (0.0, 0.0), |
| 135 | + p2_uv: Point = (1.0, 0.0), |
| 136 | + p3_uv: Point = (1.0, 1.0), |
| 137 | + p4_uv: Point = (0.0, 1.0), |
| 138 | + p1_mod: ColorLike = (255, 255, 255, 255), |
| 139 | + p2_mod: ColorLike = (255, 255, 255, 255), |
| 140 | + p3_mod: ColorLike = (255, 255, 255, 255), |
| 141 | + p4_mod: ColorLike = (255, 255, 255, 255), |
| 142 | + ) -> None: ... |
| 143 | + def get_rect(self, **kwargs: Any) -> Rect: ... |
| 144 | + def update(self, surface: Surface, area: Optional[RectLike] = None) -> None: ... |
78 | 145 |
|
79 | 146 | @final |
80 | 147 | class Image: |
|
0 commit comments