-
Notifications
You must be signed in to change notification settings - Fork 1
/
MainMenu.py
29 lines (22 loc) · 868 Bytes
/
MainMenu.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
import pyglet
from pyglet.window import Window
from pyglet import app
from pyglet.gl import *
from GenericGraphics import *
def MainMenu(window, batch, InputStack):
MainMenuGraphics(batch)
PrepareEventLoop(InputStack)
app.run()
def MainMenuGraphics(batch):
background = pyglet.graphics.OrderedGroup(0)
foreground = pyglet.graphics.OrderedGroup(1)
playButton = pyglet.shapes.Rectangle(300, 550, 200, 50, color=(200, 200, 200), batch=batch, group=background)
playButton.opacity = 255
playLabel = pyglet.text.Label('Play',font_name='Times New Roman', font_size=36, x=350, y=562, color=(200, 0, 90, 255), batch=batch, group=foreground)
def PrepareEventLoop(InputStack):
event_loop = pyglet.app.EventLoop()
@event_loop.event
def on_exit():
l = InputStack.popKeyInputs()
for key in l:
print(key)