Skip to content

Commit fb28eea

Browse files
authored
fix sprite init (#2376)
1 parent 308509c commit fb28eea

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

arcade/sprite/base.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class BasicSprite:
5757
def __init__(
5858
self,
5959
texture: Texture,
60-
scale: float = 1.0,
60+
scale: float | Point2 = 1.0,
6161
center_x: float = 0,
6262
center_y: float = 0,
6363
visible: bool = True,
@@ -67,9 +67,9 @@ def __init__(
6767
self._depth = 0.0
6868
self._texture = texture
6969
width, height = texture.size
70-
self._width = width * scale
71-
self._height = height * scale
72-
self._scale = (scale, scale)
70+
self._scale = (scale, scale) if isinstance(scale, (float, int)) else scale
71+
self._width = width * self._scale[0]
72+
self._height = height * self._scale[1]
7373
self._visible = bool(visible)
7474
self._color: Color = WHITE
7575
self.sprite_lists: list["SpriteList"] = []

0 commit comments

Comments
 (0)