Skip to content

Commit bec1d64

Browse files
authored
feat(gui): improve rotation support in UIImage (#2401)
1 parent 4f4028b commit bec1d64

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

arcade/gui/widgets/image.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,16 @@ class UIImage(UIWidget):
1717
1818
If no size given, the texture size is used.
1919
20+
The UIImage supports rotation and alpha values, which only apply to the texture.
21+
Border, and background color are not affected by this.
22+
The size of the image is reduced when rotated to stay within bounce of the widget.
23+
2024
Args:
2125
texture: Texture to show
2226
width: width of widget
2327
height: height of widget
28+
angle: angle of the texture in degrees
29+
alpha: alpha value of the texture, value between 0 and 255
2430
**kwargs: passed to UIWidget
2531
"""
2632

@@ -39,9 +45,13 @@ def __init__(
3945
texture: Union[Texture, NinePatchTexture],
4046
width: float | None = None,
4147
height: float | None = None,
48+
angle: int = 0,
49+
alpha: int = 255,
4250
**kwargs,
4351
):
4452
self.texture = texture
53+
self.angle = angle
54+
self.alpha = alpha
4555

4656
super().__init__(
4757
width=width if width else texture.width,

0 commit comments

Comments
 (0)