Add comments in UiImage.py

This commit is contained in:
Michał Czekański 2020-05-14 21:18:57 +02:00 committed by Marcin Kostrzewski
parent 08643c7083
commit aab779d4e1

View File

@ -3,7 +3,14 @@ import pygame
class UiImage(UiElement): class UiImage(UiElement):
image: pygame.Surface
def __init__(self, rect: pygame.Rect, 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) super().__init__(rect)
self.image = pygame.transform.scale(image, (rect.width, rect.height)) self.image = pygame.transform.scale(image, (rect.width, rect.height))