-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGuiHandler.py
More file actions
29 lines (20 loc) · 739 Bytes
/
GuiHandler.py
File metadata and controls
29 lines (20 loc) · 739 Bytes
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 pygame as pg;
class GuiHandler :
def __init__(self, game) :
self.game = game;
self.currentGui = 0;
pg.font.init();
self.font = pg.font.Font("resources/gui/rusa.ttf", 19);
self.font.set_bold(True);
def openGui(self, gui) :
self.currentGui = gui;
self.game.state = self.game.stateDict["menu"];
def closeGui(self) :
self.game.state = self.game.stateDict["world"];
self.currentGui = 0;
def update(self, game, events) :
if self.currentGui != 0 :
self.currentGui.update(game, events, self.font);
def render(self, display) :
if self.currentGui != 0 :
self.currentGui.render(display, self.font);