Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions arcade/gui/widgets/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,16 @@ class UIImage(UIWidget):

If no size given, the texture size is used.

The UIImage supports rotation and alpha values, which only apply to the texture.
Border, and background color are not affected by this.
The size of the image is reduced when rotated to stay within bounce of the widget.

Args:
texture: Texture to show
width: width of widget
height: height of widget
angle: angle of the texture in degrees
alpha: alpha value of the texture, value between 0 and 255
**kwargs: passed to UIWidget
"""

Expand All @@ -39,9 +45,13 @@ def __init__(
texture: Union[Texture, NinePatchTexture],
width: float | None = None,
height: float | None = None,
angle: int = 0,
alpha: int = 255,
**kwargs,
):
self.texture = texture
self.angle = angle
self.alpha = alpha

super().__init__(
width=width if width else texture.width,
Expand Down