Thank you man
You helped a lot, i wanna see the ssk2
Now you can understand (or not) my problem
I was trying to make some buttons but i don’t like to create every button i need, then i was thinking in a function to do it for me but didn’t work.
Its was just a test to see if works, and now it’s working ¯_(ツ)_/¯
[lua]
halfw = display.contentWidth/2
halfh = display.contentHeight/2
display.newImage(“images/alo.png”, halfw , halfh) --bkg
as = display.newText(“alo”, halfw , halfh - 100) --text that appears and disappears
as:setFillColor(1,0,0)
as.alpha = 0
function show(self, event)
if event.phase == “began” then
self:removeEventListener(“touch”, show)
if self == square then
as.alpha = 1
else
as.alpha = 0
end
end
end
function createSquare(w, h, x ,y)
sq = display.newRect(w, h , x, y)
sq:setFillColor(0,0,0)
return sq
end
square = createSquare(halfw, halfh, 40, 40)
square2 = createSquare(halfw/2, halfh/2, 40, 40)
square.touch = show
square:addEventListener(“touch”, square)
square2.touch = show
square2:addEventListener(“touch”, square2)[/lua]
obs: if have some error in the code is cuz i’m translating manually