From: lbcmk <30442978+lbcmk@users.noreply.github.com> Date: Wed, 13 Jul 2022 00:40:51 +0000 (-0400) Subject: Change potionUI X-Git-Url: http://git.skullheadx.com/now.html?a=commitdiff_plain;h=8633ef80236e4f92bf8b335a9aa469bef238c907;p=Pygame-Jam.git Change potionUI --- diff --git a/UI/PotionUI.py b/UI/PotionUI.py index 71b42e6..a7f8b7e 100644 --- a/UI/PotionUI.py +++ b/UI/PotionUI.py @@ -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)