I am getting crashes when I build my app for a device or for the Xcode simulator. The problem is, certain images do not display in Xcode simulator, and when I build for device, when you would go to the scene in director with the disappearing image, it would crash. For example, here is my credits screen. All it should do is display the credits background image, and a back button. When I build it in Xcode simulator, when I go to my credits page, the background does not show up. Then when I build it for my device and import it onto my phone, when I click the credits button, the app closes itself. This is a difficult problem because I do not know how to even go about diagnosing this problem because I do not get any errors. I should note that it runs fine on Corona’s simulator and the images display properly.
[lua]
module(…, package.seeall);
function new()
local Scene = display.newGroup();
local GUI = display.newGroup();
Scene:insert(GUI);
–Background Images
local bg_rect = display.newRect(0,0,_H * 1.5,_W * 1.5);
local back_btn = display.newText(“back”, 0, 0, “Chalkduster”, 48)
back_btn:setTextColor(0, 0, 0);
back_btn.x = 0 + (back_btn.width * 0.5); back_btn.y = (_H * 0.9);
local background_img = display.newImage(“images/credits_bg2.png”, true);
background_img.x = _W * 0.5; background_img.y = _H * 0.5;
bg_rect.x = _W * 0.5; bg_rect.y = _H * 0.5;
bg_rect:setFillColor(0, 174, 239);
back_btn.scene = “menu”;
GUI:insert(bg_rect);
GUI:insert(background_img);
GUI:insert(back_btn);
local function changeScene(e)
if(e.phase == “ended” or e.phase == “cancelled”) then
director:changeScene(e.target.scene);
end
end
back_btn:addEventListener(“touch”, changeScene);
Scene:insert(GUI);
return Scene
end[/lua]
Any insight would be appreciated even if it is not a solution because I don’t even know how to go about solving this. [import]uid: 50511 topic_id: 25584 reply_id: 325584[/import]
[import]uid: 52491 topic_id: 25584 reply_id: 103493[/import]