Hi, im making a game with multiples menues.
Lets say I have 4 buttons on the left of the game and each one (if pressed), loads an image on the bottom of the device, that image could be changed 3 more times (4 items per button, 16 in total)
I’m having some problems trying to achieve this.
I’ve tried groups (4 groups) but I had 2 problems:
- I dont know how to initialize an image without rendering it, I need it to insert it to the group and call a function later in the script.
- whenever I press the “next” button, the first image is still there, tried removeself, isvisible = false but nothing.
Basically this is the code (resumed):
[lua]local button_01_01 = display.newImage(“button_01_01.png”)
local button_01_02 = display.newImage(“button_01_02.png”)
local button_01_03 = display.newImage(“button_01_03.png”)
local button_01_04 = display.newImage(“button_01_04.png”)
local group01 = display.newGroup()
group01:insert (button_01_01)
group01:insert (button_01_02)
group01.x = -100; group01.y = -100
group01.isVisible = true
function press01 (event)
local menu01 = display.newImage(“button_01_01.png”)
menu01.x = 160
menu01.y = 428
group01[1].x = 250
group01[1].y = 520
function group001 (event)
group01[2].x = 250
group01[2].y = 520
end
button_ChangeRight:addEventListener(“touch”,group001)
end
button_01:addEventListener(“touch”,press01)
[/lua]
I could take some help over here, thanks in advance. [import]uid: 108461 topic_id: 20377 reply_id: 320377[/import]

