blob: 94c5787d6da8c6f6413dd6a3ee99f6464254cda7 (
plain)
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
# -*- coding: utf-8 -*-
import pygame
import MenuState
from api.GameState import CGameState
from api.Game import CGame
from api.Button import CButton
import api.Image as CImage
#from api.Globe import Globe
class CCreditsState(CGameState):
mBackground = None
mInstructions = None
#mX = 10
mButtonBack = None
def init(self):
CGameState.init(self)
self.mButtonBack = CButton()
self.mButtonBack.set_bgColor((0x99, 0x99, 0x66))
self.mButtonBack.font = pygame.font.Font('assets/fonts/DejaVuSans.ttf', 20)
self.mButtonBack.set_center((300, 300))
self.mButtonBack.set_size((200, 40))
self.mButtonBack.set_text("Volver") #_('BACK Credits')
CGame().addChild(self.mButtonBack)
self.mBackground = CImage.loadImage('assets/images/back_credits.png', False)
CGame().setBackground(self.mBackground)
"""t = "hola esto\nes una simple\nprueba de\nconcepto"
self.mGlobe = Globe((200, 200), text=t)
self.mGlobe.set_center((200, 200))
CGame().addChild(self.mGlobe)"""
def update(self):
#print "menu update"
CGameState.update(self)
if self.mButtonBack.clicked():
print "clicked back......"
ms = MenuState.CMenuState()
CGame().setState(ms)
def destroy(self):
CGameState.destroy(self)
CGame().removeChild(self.mButtonBack)
self.mButtonBack = None
self.mBackground = None
#CGame().removeChild(self.mGlobe)
print "CMenuState destroy"
def doEvents(self, aEvent):
print aEvent.type
|