made progress on card resizing

This commit is contained in:
2023-12-12 22:30:44 +01:00
parent 3279713778
commit 386aaddae3
7 changed files with 23 additions and 16 deletions

View File

@ -74,10 +74,12 @@ class App:
if field.getSide() == "Player":
if field.getType() == "MonsterField" and card.getType() == "MonsterCard":
# todo: resize card so that it fits into the card field
pygame.transform.scale(card.image,(int((field.getRect().width - 10)),int((field.getRect().height - 10))))
card.rect.center = field.getRect().center
# card.image = pygame.transform.scale(card.image, (field.getSize()[0] - 10, field.getSize()[1] - 10))
card.rect.center = field.rect.center
field.image = card.image.copy()
card.setDragging(False)
self.__window.getScreen().blit(card.image, field.getRect().center)
# card.kill()
elif event.type == pygame.MOUSEBUTTONUP:
if event.button == 1: # Wenn linke Maustaste losgelassen wird