Files
mfe9/app.py
Rich a36e9d92ed .
2023-12-07 14:59:54 +00:00

54 lines
1.3 KiB
Python

import pygame
from config import cfg
from emu import emu
from gui import gui
class application:
def __init__(self):
print(cfg["Engine"])
self.gfx = gfx_pygame.gfx_pygame()
self.gfx.setIcon("arcade.png")
if cfg["FullScreen"]:
self.screen = self.gfx.dispSetMode(cfg["ResolutionX"], cfg["ResolutionY"], True)
else:
self.screen = self.gfx.dispSetMode(cfg["ResolutionX"], cfg["ResolutionY"], False)
self.font = self.gfx.getFont(cfg["Font"], cfg["FontSize"])
self.status = self.gfx.getSurface(cfg["ResolutionX"], cfg["FontSize"])
self.listwidth = int(cfg["ResolutionX"] / 2)
self.emu = emu()
self.gui = gui(self.gfx, self.screen, self.font)
self.gui.add_menu(
0,
0,
self.listwidth,
cfg["ResolutionY"] - self.font.get_height(),
border=False,
# data=self.roms,
data=["1", "2"],
fg=(255, 255, 255),
bg=(0, 0, 0),
name="MainList",
# startitem=get_emu('CurrentGame'),
# itemattop=get_emu('GameAtTop'))
startitem=0,
itemattop=0,
)
self.gui.render()
def run(self):
pass
while True:
self.gui.render()
self.gfx.tick(60)