From: lbcmk <30442978+lbcmk@users.noreply.github.com> Date: Sat, 9 Jul 2022 07:25:59 +0000 (-0400) Subject: Changed text so it uses the createText function X-Git-Url: http://git.skullheadx.com/pfp.webp?a=commitdiff_plain;h=c28a670983a23872a4fa2ac1ab756dc75b8fe998;p=Pygame-Jam.git Changed text so it uses the createText function --- diff --git a/Player.py b/Player.py index 7da81c6..1a65cab 100644 --- a/Player.py +++ b/Player.py @@ -8,7 +8,8 @@ from Actors import Actor from datetime import datetime, timedelta from Potion import Potion from Weapon import Melee - +from CommonImports.colours import red, white +from Function.createText import createText class Player(Actor): scale = 100 @@ -169,11 +170,9 @@ class Player(Actor): foreground_rect.center = ( background_rect.centerx - 1080 * 0.185 * ((1 - self.health * 0.01) / 2), background_rect.centery) pg.draw.rect(surf, (54, 54, 54), background_rect) - pg.draw.rect(surf, (255, 0, 0), foreground_rect) + pg.draw.rect(surf, red, foreground_rect) # text - font = pg.font.Font("Font/Exo2-Regular.ttf", 30) - current_health = str(self.health) + "/100" - current_health_display = font.render(current_health, True, (255, 255, 255)) + current_health_display = createText(0, 0, 30, white, "Regular", str(self.health) + "/100")[0] text_rect = current_health_display.get_rect(center=background_rect.center) - surf.blit(current_health_display, text_rect) + surf.blit(current_health_display, text_rect) \ No newline at end of file