def __init__(self): pyggel.scene.BaseSceneObject.__init__(self) self.event_handler = pyggel.event.Handler() self.app = pyggel.gui.App(self.event_handler) self.app.theme.load(data.gui_path("menu_theme.py")) frame = pyggel.gui.Frame(self.app, pos=(500,275), size=(150,175), background_image=None) frame.packer.packtype = "center" pyggel.gui.Button(frame, "Play", callbacks=[self.set_play]) pyggel.gui.NewLine(frame, 10) pyggel.gui.Button(frame, "Back", callbacks=[self.set_back]) f = open(data.misc_path("intro_story.txt"), "rU") text = "\n".join([line.strip() for line in f]) l = pyggel.gui.Label(self.app, text, font_color=(0,0,0,1), font_color_inactive=(0,0,0,1), font="default-small") l.pos = (0,480-l.size[1]) self.background_image = pyggel.image.Image(data.image_path("background_crop_circle.png")) self.logo_image = pyggel.image.Image(data.image_path("chickenstein_logo.png")) self.scene = pyggel.scene.Scene() self.scene.add_2d((self.background_image, self.logo_image)) self.scene.add_2d(self.app) self.have_event = False self.event = None
def __init__(self): pyggel.scene.BaseSceneObject.__init__(self) self.event_handler = pyggel.event.Handler() self.app = pyggel.gui.App(self.event_handler) self.app.theme.load(data.gui_path("menu_theme.py")) frame = pyggel.gui.Frame(self.app, pos=(450,250), size=(175,225), background_image=None) frame.packer.packtype = "center" pyggel.gui.Button(frame, "play", callbacks=[self.set_play]) pyggel.gui.NewLine(frame, 10) pyggel.gui.Button(frame, "levelwarp", callbacks=[self.set_level]) pyggel.gui.NewLine(frame, 10) pyggel.gui.Button(frame, "story", callbacks=[self.set_story]) pyggel.gui.NewLine(frame, 10) pyggel.gui.Button(frame, "quit", callbacks=[self.set_quit]) self.background_image = pyggel.image.Image(data.image_path("background_crop_circle.png")) self.logo_image = pyggel.image.Image(data.image_path("chickenstein_logo.png")) self.scene = pyggel.scene.Scene() self.scene.add_2d((self.background_image, self.logo_image)) self.scene.add_2d(self.app) self.have_event = False self.event = None