-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtaskbar.py
More file actions
46 lines (33 loc) · 1.29 KB
/
taskbar.py
File metadata and controls
46 lines (33 loc) · 1.29 KB
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
40
41
42
43
44
45
46
import pygame
from datetime import datetime
class Taskbar:
def __init__(self, x, y):
self.image = pygame.image.load("assets/taskbar.png")
self.rect = self.image.get_rect(x=x, y=y)
def draw(self, screen):
screen.blit(self.image, self.rect)
class Hour:
def __init__(self, x, y):
now = datetime.now()
current_time = now.strftime("%H:%M")
interval = "PM"
self.hour = "{} {}".format(current_time, interval)
self.font = pygame.font.Font('assets/W95FA.otf', 18)
self.text = self.font.render(self.hour, True, "black")
self.text_rect = self.text.get_rect(x=x, y=y)
def draw(self, screen):
self.text = self.font.render(self.hour, True, "black")
screen.blit(self.text, self.text_rect)
class Start:
def __init__(self, x, y):
self.image = pygame.image.load("assets/start.png")
self.rect = self.image.get_rect(x=x, y=y)
def draw(self, screen):
screen.blit(self.image, self.rect)
class Menu:
def __init__(self, x, y):
self.image = pygame.image.load("assets/menu.png")
self.image = pygame.transform.scale(self.image, (275.52, 441.84))
self.rect = self.image.get_rect(x=x, y=y)
def draw(self, screen):
screen.blit(self.image, self.rect)