I have three objects that I want to hide upon touch. Every time I touch one object the other two are hidden as well. I want to be able to touch each object and hide that specific object. Here is my code so far:
display.setStatusBar (display.HiddenStatusBar)
local background = display.newImage (“background.png”)
local circle = display.newImage(“circle.png”)
circle.x = 170 circle.y = 230
local square = display.newImage(“square.png”)
square.x = 120 square.y = 330
local triangle = display.newImage(“triangle.png”)
triangle.x = 230 triangle.y = 392
local function hidecircle (event)
circle.isVisible = false
end
local function hidesquare (event)
square.isVisible = false
end
local function hidetriangle (event)
triangle.isVisible = false
end
circle:addEventListener (“touch” , hidecircle)
square:addEventListener (“touch” , hidesquare)
triangle:addEventListener (“touch” , hidetriangle) [import]uid: 3318 topic_id: 10871 reply_id: 310871[/import]
[import]uid: 52491 topic_id: 10871 reply_id: 39776[/import]