int playstate::SceneGroup_Load(lua_State* L) { const playstate::string fileName = lua_tostring(L, -1); lua_pop(L, 1); try { ScriptSystem& scriptSystem = ScriptSystem::Get(); std::auto_ptr<Script> script = scriptSystem.CompileFile(fileName); SceneGroup* group = script->ReadInstance<SceneGroup>(); if(group == NULL) { ILogger::Get().Error("The file: '%s' did not return a scene group.", fileName.c_str()); lua_pushnil(L); } else luaM_pushobject(L, "SceneGroup", group); return 1; } catch(ScriptException e) { ILogger::Get().Error("Could not load scene group: '%s'. Reason: '%s'", fileName.c_str(), e.GetMessage().c_str()); } lua_pushnil(L); return 1; }
int playstate::Canvas_Show(lua_State* L) { int numParams = lua_gettop(L); if(numParams < 1) { luaM_printerror(L, "Expected: Canvas.Show(name : String)"); return 0; } const playstate::string name = lua_tostring(L, -1); lua_pop(L, 1); Canvas& canvas = GameRunner::Get().GetCanvas(); CanvasGroup* group = canvas.GetCanvasGroupByName(name); if(group != NULL) { //group->Show(); } else { luaM_printerror(L, "Could not find a CanvasGroup by the name of: '%s'", name.c_str()); } assert_not_implemented(); return 0; }