「レシピ」の例でディレクトリを使用しようとしています..タイマーに問題があります
ページを実行するmain.lua
と、ロゴとウェルカムメッセージが表示され、最初にアプリケーションを使用するときにのみユーザー名とモバイルを取得してtxtファイルに保存する画面があるイントロページに移動する必要があります。次回はそのtxtファイルをチェックします..
次に、ユーザーが選択できる「メニュー」ページに移動します
私の問題は、main.lua
I use timer to show the logo, but this timer still work in other screen です。
Main.lua (cdoe)
_w = display.viewableContentWidth
_h = display.viewableContentHeight
local background = display.newRect(0,0,_w,_h)
background:setFillColor( 234, 234, 234 )
local obj = display.newImage( "ams_logo.jpg" )
-- center the object
obj.x = display.contentWidth*0.5
obj.y = display.contentHeight*0.5
-- fade object to completely transparent
local transition_id = transition.from( obj, { time=2000, alpha=0 } )
--local textObject = display.newText( "Welcome to AMS project", 20, 350, native.systemFont, 24 )
local textObject = display.newText( "Welcome to AMS project", _w*.1, _h*.8, native.systemFont, 24 )
textObject:setTextColor( 255,144,0 )
local transition_id = transition.from( textObject, { time=1500, alpha=0 })
function changeScene (e)
if(e.phase == "ended") then
director:changeScene(e.target.scene)
end
end
local director = require("director");
local mainGroup = display.newGroup();
mainGroup:insert(director.directorView);
display.setStatusBar(display.HiddenStatusBar) _W = display.contentWidth _H = display.contentHeight number = 0
function fn_counter()
director:changeScene("intro");
end
timer.performWithDelay(5500, fn_counter, 0)
the intro .lua
module(..., package.seeall)
function new()
local introGroup = display.newGroup();
local background = display.newImage("graphics/intro_background.png")
local begin = display.newImage("graphics/begin_button.png")
begin.x = 160;
begin.y = 400;
begin.scene = "menu";
introGroup:insert(background);
introGroup:insert(begin);
begin:addEventListener("touch", changeScene);
return introGroup;
end
私を助けてください ..