Navigation 日冕中的Lua导航
我有一个level1.lua独立的工作程序。但是,当我想使用Navigation 日冕中的Lua导航,navigation,lua,coronasdk,Navigation,Lua,Coronasdk,我有一个level1.lua独立的工作程序。但是,当我想使用gotoScene()导航到它时,它不会播放 local storyboard = require "storyboard" local scene = storyboard.newScene("level1") local function level1_pressed() storyboard.gotoScene( "level1", "fade" ,40 ) print("level1 should start"
gotoScene()
导航到它时,它不会播放
local storyboard = require "storyboard"
local scene = storyboard.newScene("level1")
local function level1_pressed()
storyboard.gotoScene( "level1", "fade" ,40 )
print("level1 should start")
return true
end
local level1 = display.newText( "level1",20 ,20,font, 40 )
level1:setTextColor(math.random( 50, 200 ),math.random( 50, 200 ),math.random( 50, 200 ))
level1:addEventListener( "touch", level1_pressed )
这是我的主要任务。
“level1应该开始”字符串正确打印在终端上,但它没有开始!
有什么问题吗?你读了吗?level1.lua应该包含以下内容。另请查看第页的故事板教程。根据上提供的故事板文档,您的storyboard.gotoScene()语法不正确
local storyboard = require "storyboard"
local scene = storyboard.newScene("level1")
local options = {
effect = "fade",
time = 40
}
local function level1_pressed()
storyboard.gotoScene( "level1", options)
print("level1 should start")
return true
end
local level1 = display.newText( "level1",20 ,20,font, 40 )
level1:setTextColor(math.random( 50, 200 ),math.random( 50, 200 ),math.random( 50, 200 ))
level1:addEventListener( "touch", level1_pressed )