-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhome_screen.py
More file actions
36 lines (30 loc) · 1.12 KB
/
Copy pathhome_screen.py
File metadata and controls
36 lines (30 loc) · 1.12 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
import pygame
class HomeScreen:
def __init__(self, screen):
self.screen = screen
self.font = pygame.font.Font(pygame.font.match_font('monospace'), 24) # Load monospace font
def show_welcome_message(self):
welcome_text = self.font.render("Welcome to LLEMagnetSim", True, (255, 255, 255))
self.screen.blit(welcome_text, (50, 50))
pygame.display.flip()
def fade_to_magnetar_display(self):
# Implement fade effect here
pass
import pygame
import csv
class MagnetarDisplay:
def __init__(self, screen):
self.screen = screen
self.font = pygame.font.Font(pygame.font.match_font('monospace'), 24) # Load monospace font
def load_data(self, data_source):
with open(data_source, newline='') as csvfile:
reader = csv.reader(csvfile)
self.data = list(reader)
def render(self):
self.screen.fill((0, 0, 0))
y = 50
for row in self.data:
text = self.font.render(', '.join(row), True, (255, 255, 255))
self.screen.blit(text, (50, y))
y += 30
pygame.display.flip()