-
Notifications
You must be signed in to change notification settings - Fork 0
/
startmenu.py
36 lines (30 loc) · 1.07 KB
/
startmenu.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
import pygame
import globals
globals.WIN = pygame.display.set_mode((globals.WIDTH, globals.HEIGHT));
import pygame_menu
from main import main
import help
import credits
import fonts
pygame.mixer.pre_init(44100, -16, 2, 2048)
pygame.init()
menuTheme = pygame_menu.themes.Theme(background_color=(0, 0, 0, 255),
title_shadow=True,
title_background_color=(0, 0, 0),
title_bar_style=pygame_menu.widgets.MENUBAR_STYLE_SIMPLE,
widget_font=pygame_menu.font.FONT_BEBAS)
def menu():
fonts.font_init()
menu = pygame_menu.Menu(globals.HEIGHT,globals.WIDTH, 'GameJam 2021',
theme=menuTheme)
menu.add_image("assets/title.png")
menu.add_vertical_margin(100)
globals.NAME = menu.add_text_input('Nom : ', default='Player')
menu.add_vertical_margin(100)
menu.add_button('Jouer', main)
menu.add_button('Aide', help.help)
menu.add_button('Credits', credits.credits)
menu.add_button('Quitter', pygame_menu.events.EXIT)
menu.mainloop(globals.WIN)
if __name__ == "__main__":
menu()