I’m using a world/level select tutorial and one thing it doesn’t cover is how to change the “default” image.
Here’s the code I’m using.
function scene:createScene( event )
local group = self.view
local background = display.newImageRect("background.png",1280,647)
group:insert(background)
background.x = 240; background.y = 160
background:addEventListener("touch",backgroundTouch)
group:insert(background)
group:insert(buttonGroup)
-- create three widget buttons to select the game world
for i=1,maxWorlds do
worlds[i] = widget.newButton{
label="World "..i,
default = "worlds.png",
id=i,
width=128, height=328,
onEvent = buttontouch -- event listener function
}
worlds[i].x = (i\*130) + (i % 1)\*20
worlds[i].y = display.contentHeight \* 0.5
-- If you are using the last publicly available version of Corona, you may
-- need to replace the following line with:
-- group:insert( worlds[i].view )
buttonGroup:insert( worlds[i] )
end
end
I’m trying to create 6 unique images for all 6 of the world buttons generated. Any help doing so would be greatly appreciated. [import]uid: 72845 topic_id: 34664 reply_id: 334664[/import]