]> Skullheadx's Git Forge - Pygame-Jam.git/commitdiff
Change potionUI
authorlbcmk <30442978+lbcmk@users.noreply.github.com>
Wed, 13 Jul 2022 00:40:51 +0000 (20:40 -0400)
committerlbcmk <30442978+lbcmk@users.noreply.github.com>
Wed, 13 Jul 2022 00:40:51 +0000 (20:40 -0400)
UI/PotionUI.py

index 71b42e63e30d55ba9529c66a9821ed27a53642b4..a7f8b7ec53d7cea5f472e6f1aa6ceba024b46906 100644 (file)
@@ -8,19 +8,25 @@ from CommonImports.colours import white
 class PotionUI:
 
     def __init__(self):
-        return;
+        self.X = 20
+        self.Y = 70
+        self.d = 35
+
+        buttonImage = pg.image.load('./Assets/world/decor/HEALTHPOTION.png')
+        self.potionImage= pg.transform.scale(buttonImage, (30, 30))
 
     def update(self):
         return;
 
     def draw(self, surf, potion_bag, potion_cooldown):
         #Amount of Potions Display
-        num_of_potions = createText(0, 0, 30, white, "Regular", str(len(potion_bag)) + " Potions")[0]
-        potion_text_rect = num_of_potions.get_rect(left = 20, top = 70)
-        surf.blit(num_of_potions, potion_text_rect)
+        # num_of_potions = createText(0, 0, 30, white, "Regular", str(len(potion_bag)) + " Potions")[0]
+        for i in range(len(potion_bag)):
+            potion_text_rect = self.potionImage.get_rect(left = 20+(self.d*i), top = 70)
+            surf.blit(self.potionImage, potion_text_rect)
 
         #Cooldown Display
         if potion_cooldown > 0:
-            potion_cd_ui = createText(0, 0, 30, white, "Regular", str(potion_cooldown) + " until potion can be used")[0]
-            potion_cd_rect = num_of_potions.get_rect(left = 20, top = 100)
+            potion_cd_ui = createText(0, 0, 20, white, "Regular", str(potion_cooldown) + "s potion cooldown")[0]
+            potion_cd_rect = self.potionImage.get_rect(left = 20, top = 100)
             surf.blit(potion_cd_ui, potion_cd_rect)