|
|
@@ -1,5 +1,6 @@ |
|
|
|
from . import gbe |
|
|
|
from .nodes import * |
|
|
|
from . import scenes |
|
|
|
|
|
|
|
_RUNNING = False |
|
|
|
|
|
|
@@ -31,36 +32,37 @@ def start(): |
|
|
|
sm = gbe.statemachine.StateMachine() |
|
|
|
|
|
|
|
gbe.events.Events.listen("QUIT", _OnQuit) |
|
|
|
gbe.events.Events.listen("KEYDOWN", _OnKeyEvent) |
|
|
|
gbe.events.Events.listen("KEYUP", _OnKeyEvent) |
|
|
|
gbe.events.Events.listen("KEYPRESSED", _OnKeyEvent) |
|
|
|
#gbe.events.Events.listen("KEYDOWN", _OnKeyEvent) |
|
|
|
#gbe.events.Events.listen("KEYUP", _OnKeyEvent) |
|
|
|
#gbe.events.Events.listen("KEYPRESSED", _OnKeyEvent) |
|
|
|
d = gbe.display.Display |
|
|
|
d.init(640, 480) |
|
|
|
d.caption = "Goldbox 64" |
|
|
|
d.watch_for_resize(True) |
|
|
|
d.set_clear_color(0,0,255) |
|
|
|
d.set_clear_color(0,0,0) |
|
|
|
|
|
|
|
root = NodeInterface() |
|
|
|
root.scale_to_display = True |
|
|
|
root.keep_aspect_ratio = True |
|
|
|
root.align_center = True |
|
|
|
root.set_surface((64, 64)) |
|
|
|
#root = NodeInterface() |
|
|
|
#root.scale_to_display = True |
|
|
|
#root.keep_aspect_ratio = True |
|
|
|
#root.align_center = True |
|
|
|
#root.set_surface((64, 64)) |
|
|
|
|
|
|
|
sprite = gbe.nodes.NodeSprite("Sprite", root) |
|
|
|
sprite.image = "maptiles/Walls.png" |
|
|
|
sprite.rect = (48, 32, 16, 16) |
|
|
|
sprite.position = (20, 20) |
|
|
|
#sprite = gbe.nodes.NodeSprite("Sprite", root) |
|
|
|
#sprite.image = "maptiles/Walls.png" |
|
|
|
#sprite.rect = (48, 32, 16, 16) |
|
|
|
#sprite.position = (20, 20) |
|
|
|
|
|
|
|
text = gbe.nodes.NodeText("TextNode", root) |
|
|
|
text.font_src = "IttyBitty.ttf" |
|
|
|
text.size = 4 |
|
|
|
text.antialias = False |
|
|
|
text.text = "ObsidianBlk 123456" |
|
|
|
text.set_color(255, 64, 128) |
|
|
|
text.position_y = 30 |
|
|
|
#text = gbe.nodes.NodeText("TextNode", root) |
|
|
|
#text.font_src = "IttyBitty.ttf" |
|
|
|
#text.size = 4 |
|
|
|
#text.antialias = False |
|
|
|
#text.text = "ObsidianBlk 123456" |
|
|
|
#text.set_color(255, 64, 128) |
|
|
|
#text.position_y = 30 |
|
|
|
|
|
|
|
sm.register_node(root) |
|
|
|
sm.activate_node(root.name) |
|
|
|
e = scenes.editor.get() |
|
|
|
sm.register_node(e) |
|
|
|
sm.activate_node(e.name) |
|
|
|
|
|
|
|
_RUNNING = True |
|
|
|
while _RUNNING: |