Hello. I have make all windows for my game but i don’t know how to make visable and hide windows.
This is first windows
from gui.controls import *
#from bazadanych import *
from ui import *
class Menu_start(Form):
def __init__(self,game):
Form.__init__(self," ",size=Vec2(200,200),pos=Vec2(300,200))
gui.add(self)
# add test button
self.add(Button('Nowa Gra', pos=Vec2(70,30), size=Vec2(50,16), onClick=self.nowa))
self.add(Button('Wczytaj', pos=Vec2(70,60), size=Vec2(50,16), onClick=self.wczytaj))
self.add(Button('Opcje', pos=Vec2(70,90), size=Vec2(50,16), onClick=self.opcje))
self.add(Button('Aktualizacja', pos=Vec2(70,120), size=Vec2(50,16), onClick=self.aktualizacja))
self.add(Button('Wyjdz z gry', pos=Vec2(70,150), size=Vec2(50,16), onClick=self.wyjdz_z_gry))
def nowa(self,button,key,pos):
print 'Button pressed'
self.Postac.toggle() <-------------------
def wczytaj(self,button,key,pos):
print 'Button pressed'
def opcje(self,button,key,pos):
print 'Button pressed'
def aktualizacja(self,button,key,pos):
print 'Button pressed'
def wyjdz_z_gry(self,button,key,pos):
print 'Button pressed'
And exemple Postac windows
from gui.controls import *
from ui import *
class Postac(Form):
def __init__(self,game):
Form.__init__(self,"Glowne okno postaci",size=Vec2(400,400))
self.game = game
#napisy
self.staty
=self.add(Lable("Poziom\nDoswiadczenie\nPunkty",Vec2(20,40)))
gui.add(self)
But when i click on button ‘Nowa gra’ i see only erros