| #text.set_color(255, 64, 128) | #text.set_color(255, 64, 128) | ||||
| #text.position_y = 30 | #text.position_y = 30 | ||||
| e = scenes.editor.get() | |||||
| sm.register_node(e) | |||||
| sm.activate_node(e.name) | |||||
| sm.register_node(scenes.mainmenu.get()) | |||||
| sm.register_node(scenes.editor.get()) | |||||
| sm.activate_node("MAIN_MENU") | |||||
| _RUNNING = True | _RUNNING = True | ||||
| while _RUNNING: | while _RUNNING: |
| return | return | ||||
| if data["key_name"] == "escape": | if data["key_name"] == "escape": | ||||
| self.emit("QUIT") | |||||
| self.emit("SCENECHANGE", {"scene":"MAIN_MENU", "hold":False}) | |||||
| #self.emit("QUIT") | |||||
| if data["key_name"] == "tab": | if data["key_name"] == "tab": | ||||
| p.toggle_render_mode() | p.toggle_render_mode() | ||||
| elif data["key_name"] == "w": | elif data["key_name"] == "w": |
| from . import editor | from . import editor | ||||
| from . import mainmenu |
| from .. import gbe | |||||
| from ..nodes import * | |||||
| _TREE = None | |||||
| def get(): | |||||
| global _TREE | |||||
| if _TREE is None: | |||||
| root = gbe.nodes.NodeSurface("MAIN_MENU") | |||||
| root.scale_to_display = True | |||||
| root.keep_aspect_ratio = True | |||||
| root.align_center = True | |||||
| root.set_surface((64, 64)) | |||||
| root.set_clear_color((0,0,0,0)) | |||||
| menu = NodeOptions("Options", root) | |||||
| #menu.add_option("IttyBitty.ttf", 4, "Game", "SCENECHANGE", {"scene":"Game", "hold":False}) | |||||
| menu.add_option("IttyBitty.ttf", 4, "Editor", "SCENECHANGE", {"scene":"Editor", "hold":False}) | |||||
| menu.add_option("IttyBitty.ttf", 4, "Quit", "QUIT") | |||||
| menu.position = (10, 14) | |||||
| overlay = gbe.nodes.NodeSprite("Overlay", root) | |||||
| overlay.image = "MainMenu_Logo.png" | |||||
| _TREE = root | |||||
| return _TREE |