-
Notifications
You must be signed in to change notification settings - Fork 9
/
InfoOverlay.py
28 lines (21 loc) · 991 Bytes
/
InfoOverlay.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
import RenderObject, Configuration, Common
import os, Keys, RenderControl
import pygame, sys
class InfoOverlay(RenderObject.RenderObject):
background = None
config = Configuration.getConfiguration()
def render(self, screen):
screen.blit(self.background, (self.xOffset,self.yOffset))
def handleEvents(self, events):
for event in events:
if event.type == pygame.KEYDOWN:
if event.key == Keys.DINGOO_BUTTON_B or event.key == Keys.DINGOO_BUTTON_A:
if(self.callback != None):
self.callback(1)
RenderControl.setDirty()
def __init__(self, image, callback):
print("Opened Overlay menu ")
self.callback = callback
self.background = Common.loadImage(image)
self.xOffset = (self.config["screenWidth"] - self.background.get_width()) / 2
self.yOffset = (self.config["screenHeight"] - self.background.get_height()) / 2