-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathItemDisplay.py
39 lines (34 loc) · 1.27 KB
/
ItemDisplay.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
""" This will be for the item display window """
import pygame
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
class ItemDisplay(pygame.surface.Surface):
"""ItemDisplay class"""
def __init__(self, height, width):
pygame.surface.Surface.__init__(self, (width, height))
self.height = height
self.width = width
pygame.surface.Surface.fill(self, (155, 111, 111))
if not pygame.font.get_init():
pygame.font.init()
self.arial_font = pygame.font.SysFont("Arial", 16)
def update_stats(self, item):
"""Show the item stats"""
pygame.surface.Surface.fill(self, BLACK)
pygame.surface.Surface.blit(
self, self.arial_font.render("Item: " + item.name, True, WHITE), (0, 0)
)
pygame.surface.Surface.blit(self, item.image, (0, 20))
pygame.surface.Surface.blit(
self,
self.arial_font.render("Description: " + item.desc, True, WHITE),
(0, 60),
)
pygame.surface.Surface.blit(
self, self.arial_font.render("Slot: " + item.slot, True, WHITE), (0, 80)
)
pygame.surface.Surface.blit(
self,
self.arial_font.render("Effects: " + str(item.effects), True, WHITE),
(0, 100),
)