OK so i am making screen transitions and whenever i start my app in the simulator it completely skips the menu.lua screen and i cant figure out why, there are no errors in the terminal.
Here are the following .lua files i have:
main.lua
menu.lua
director.lua
Here is the code in the menu.lua:
module(..., package.seeall);
function new()
local Scene = display.newGroup();
local GUI = display.newGroup()
local bg\_frame = display.newImage("tree1.jpg");
local bg\_knockout = display.newImage("tree1.jpg");
local bg\_rect = display.newRect(0, 0, \_W, \_H);
bg\_rect.x = \_W \* 0.5; bg\_rect.y = \_H \* 0.5;
bg\_rect:setFillColor(100, 100, 100);
GUI:insert(bg\_rect);
GUI:insert(bg\_knockout);
GUI:insert(bg\_frame);
local title = display.newText("X-Mas Countdown Timer", 0, 0, "Times New Roman", 72)
title.x = \_W \* 0.5; title.y = (\_H \* 0.5) - 120;
local go\_btn = display.newText("GO", 0, 0, "Times New Roman", 48)
go\_btn.x = \_W \* 0.5; go\_btn.y = (\_H \* 0.5) + 120;
go\_btn.scene = "menu";
GUI:insert(title);
GUI:insert(go\_btn);
local function changeScene(e)
if(e.phase == "ended" or e.phase == "cancelled") then
director:changeScene(e.target.scene);
end
end
go\_btn:addEventListener("touch", changeScene);
Scene:insert(GUI);
return Scene
end
And here is the code that goes with this and the director class in the main.lua file:
local director = require("director")
local mainGroup = display.newGroup();
local function main()
director:changeScene("menu");
return true;
end
main();
And like i said it just skips the menu.lua screen and goes straight to the main.lua file and i cant figure out why
[import]uid: 69054 topic_id: 18740 reply_id: 318740[/import]