【发布时间】:2013-01-27 20:22:09
【问题描述】:
我有一个情节提要文件,我想引用实现情节提要的文件的名称,以便加载具有相同基本名称的配置文件。
这是一个名为 scene001.lua 的文件中的示例
-- Called when the scene's view does not exist:
function scene:createScene( event )
local screenGroup = self.view
local json = require("json")
-- load the book definition file
local contents = textFromFile("scene001.json")
local page = json.decode(contents)
image = buildPage(page)
screenGroup:insert(image)
image.touch = onSceneTouch
end
如您所见,我必须对"scene001.json" 进行硬编码。我想加载与当前故事板同名的配置文件,如何动态执行此操作?
【问题讨论】:
标签: lua coronasdk corona-storyboard