Tap is not working on the whole screen.

Hi guys, I have a “tap” event listener. I need to be able to tap in anyplace on the screen, but something weird is happening there is like a rectangle in the top left side of the simulator (and device) where the tap doesn’t work (doesn’t work means it doesn’t call the “changeLines” function), I been reading the docs, but I can’t find anything related.

This code is in a scene1.lua

local function changeLines( event ) print( "HI" ) end Runtime:addEventListener( "tap", changeLines )

The scene1.lua is called from a menu.lua and shown like:

local function handleButtonEvent( event ) if ( "ended" == event.phase ) then composer.gotoScene( "scene1", "slideLeft", 800 ) end end

Any clue?? it’s driving me crazy!

What is “handleButtonEvent” part of?  It sounds to me like you have an object that’s got a touch handler on it or a widget.newButton() that’s absorbing the touch event.  Also you need to make sure to do a “return true” if you have handled the event or the events continue to propagate through the display objects.

Rob

@andresyo990

Post the code for scene1.lua here and we’ll try to help you out.

After a couple of hours of reading my code I think I found out what was the problem… my app was calling from an scene a scene1.lua file, but that scene1.lua was not really an scene, it was just a lua file. So it was not returning a “return scene”. And I think that messed something up. I migrated all my scene1.lua to a real scene file following the template shown here: http://coronalabs.com/blog/2014/01/21/introducing-the-composer-api-plus-tutorial/ and now it’s working perfectly fine!

Thanks a lot guys for your answers! It’s hard to be a beginner!!

What is “handleButtonEvent” part of?  It sounds to me like you have an object that’s got a touch handler on it or a widget.newButton() that’s absorbing the touch event.  Also you need to make sure to do a “return true” if you have handled the event or the events continue to propagate through the display objects.

Rob

@andresyo990

Post the code for scene1.lua here and we’ll try to help you out.

After a couple of hours of reading my code I think I found out what was the problem… my app was calling from an scene a scene1.lua file, but that scene1.lua was not really an scene, it was just a lua file. So it was not returning a “return scene”. And I think that messed something up. I migrated all my scene1.lua to a real scene file following the template shown here: http://coronalabs.com/blog/2014/01/21/introducing-the-composer-api-plus-tutorial/ and now it’s working perfectly fine!

Thanks a lot guys for your answers! It’s hard to be a beginner!!