Added scene reloading & switching
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
//the overarching scene
|
||||
import engine;
|
||||
import node;
|
||||
|
||||
//debugging tools
|
||||
@@ -42,6 +43,13 @@ fn onDraw(node: opaque) {
|
||||
stepCounter = 0;
|
||||
}
|
||||
|
||||
fn onMouseButtonDown(node: opaque, x: int, y: int, button: string) {
|
||||
//reload the scene on click
|
||||
if (button == "left") {
|
||||
loadRootNode("scripts:/scene.toy");
|
||||
}
|
||||
}
|
||||
|
||||
//global accessors
|
||||
fn getTileWidth(node: opaque): int { return 64; }
|
||||
fn getTileHeight(node: opaque): int { return 64; }
|
||||
|
||||
Reference in New Issue
Block a user