Add comments in UiImage.py

This commit is contained in:
Michał Czekański 2020-05-14 21:18:57 +02:00
parent 786db30b58
commit b606124d38

View File

@ -3,7 +3,14 @@ import pygame
class UiImage(UiElement):
image: pygame.Surface
def __init__(self, rect: pygame.Rect, image: pygame.Surface):
"""
Creates UiImage object.
:param rect: Rectangle on which image will be displayed
:param image: Image to display
"""
super().__init__(rect)
self.image = pygame.transform.scale(image, (rect.width, rect.height))