I’m trying to make a tap listener to a function that uses the button’s assigned number to set it as another image. I have 5 buttons to press, and I’m trying to make it so that when you click on a button, an image on the side will take that buttons image. My question is how to make an event listener that allows me to set what the variables ButtonName and Number are.
function DoSomething(ButtonName, Number) print(tostring(ButtonName)) print(tostring(Number)) end button = display.newRect(100,100,100,100) button.tap = DoSomething button:addEventListener("tap", button)