From ed1d057be2fa22a45a8d423690b6f09b5064cb2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Czeka=C5=84ski?= Date: Sat, 4 Apr 2020 00:35:07 +0200 Subject: [PATCH] Add UiImage class --- src/ui/UiImage.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ui/UiImage.py b/src/ui/UiImage.py index d8cd485..6dbb5fc 100644 --- a/src/ui/UiImage.py +++ b/src/ui/UiImage.py @@ -1,5 +1,10 @@ -import src.ui.UiElement as UiElement +from src.ui.UiElement import UiElement +import pygame class UiImage(UiElement): - pass + def __init__(self, rect: pygame.Rect, image: pygame.Surface): + super().__init__(rect) + self.image = pygame.transform.scale(image, (rect.width, rect.height)) + +