I’m new to Corona, so i have this problem. I have watched tutorials for creating buttons and i learn it quickly, but i have a problem when i code the size of the button with a defaultFile and overFile, when i start to create a button for example:
local function ButtonEventHandler(event)
local phase = event.phase
if event.phase == “ended” then
print(" button has been pressed")
storyboard.gotoScene(“scene1”, “slideLeft”, 100)
return true
end
end
local Button1 = widget.newButton( {
left = 100,
top = 100,
width = 1280,
height = 720,
defaultFile = “Buttons/image.png”,
overFile = “Buttons/imageoff.png”,
onEvent = ButtonEventHandler,
} );
it works fine until, when i click the background(not the button) it proceed to my desire scene, i can’t solve the problem. maybe because of the size of the buttons width and height? cause when i change it to smaller size it works fine. but it’s too small(the image of the button). so i try to make it big making it 1280x720 like the size of the image then wherever i clicked on the background it’s like it became button. Sorry for bad English. i need help