我是corona sdk的新手,並試圖在其中構建示例。我想在一段時間後自動回到主屏幕,通過摧毀我的場景(我的意思是這個場景在特定時間後會自行破壞,用戶返回主屏幕)。我知道,對於某些人來說,這可能聽起來很愚蠢,但我初學者到科羅娜storyboard.removeScene(「場景名稱」)不起作用
這裏是我的main.lua代碼: -
local storyboard = require "storyboard"
local widget = require("widget")
--/**/ widget.setTheme("widget_theme_android")
local json = require "json"
local particleDesigner = require("particleDesigner")
local physics = require("physics")
physics.start()
-------------------------------------------------------------------------------
local sky = display.newImage("sky.jpg",contentCenterX,display.contentCenterY)
local emitter
\t \t emitter = particleDesigner.newEmitter("air_stars.json")
\t \t emitter.x = (contentCenterX)
\t \t emitter.y = (contentCenterY)
local button = {}
y= -50
for count = 1,3 do
y = y + 110
x = 20
for insideCount = 1,3 do
x = x + 110
button[count] = display.newImage("1.png")
button[count].x = x
button[count].y = y
local container = display.newContainer(0, 0)
container:translate(button[count].x-40, button[count].y-40)
local bkgd = display.newImage(container, "2.png")
function buttonTap(self)
button[count].touch = transition.to(container,{time=3000, height = button[count].height+x, width = button[count].width+y, onComplete = StartGame})
function StartGame()
storyboard.purgeScene("main")
if count == 1 and insideCount == 1 then
storyboard:gotoScene("bridge")
elseif count == 1 and insideCount == 2 then
storyboard:gotoScene("Heli")
end
end
end
button[count]:addEventListener("touch", buttonTap)
end
end
return storyboard
,這裏是我的bridge.lua文件: - (http://piratepad.net/ep/pad/view/ro.JR1Bpt1qkA $ /最新)
任何幫助將不勝感激
感謝
其實我想要的是當我點擊特定的按鈕動畫應該出現在那個我沒有點擊的按鈕上,其次動畫應該從按鈕的中間開始,慢慢地覆蓋按鈕的整個高度和寬度 – sid