diff --git a/src/haxe/gengine/Main.hx b/src/haxe/gengine/Main.hx index a3ee232..8d725fa 100644 --- a/src/haxe/gengine/Main.hx +++ b/src/haxe/gengine/Main.hx @@ -29,7 +29,8 @@ class Main engine.entityAdded.add(onEntityAdded); engine.entityRemoved.add(onEntityRemoved); - untyped __js__("window.dummyNode = gengine.getScene().createChild(0, 0, false);"); + untyped __js__("window.dummyNode = gengine.getScene().createChild(0, 0, false)"); + untyped __js__("window.dummyNode.setName('dummyNode')"); untyped __js__("window.dummyNode.setEnabled(false)"); engine.addSystem(new Physics2DSystem(), 1); diff --git a/src/script/script_scene.cpp b/src/script/script_scene.cpp index 6664c6d..139bebe 100644 --- a/src/script/script_scene.cpp +++ b/src/script/script_scene.cpp @@ -9,6 +9,7 @@ using namespace Urho3D; +EMBINDCEFV8_DECLARE_STRING(String, CString); EMBINDCEFV8_DECLARE_ENUM(CreateMode); EMBINDCEFV8_DECLARE_ENUM(TransformSpace); EMBINDCEFV8_DECLARE_CLASS(Scene); @@ -22,6 +23,7 @@ EMBINDCEFV8_BINDINGS(scene) embindcefv8::Class("Node") .constructor() + .method("setName", &Node::SetName) .method("setPosition", &Node::SetPosition) .method("setWorldPosition", &Node::SetWorldPosition) .method("setRotation", &Node::SetRotation)