App doesn't detect touch event in a specific screen area

Hi guys, as you can see from the title, my app doesn’t recognize touch events in the area marked with the “X” in the picture I’ve attached, and I really can’t figured out why. 

Could you help me please? Thanks!

It’s not possible to tell without some sample code.

BTW, do you see the same problem if you run one of the Corona samples (or other apps)?

If you do, then you might have a digitizer problem.

How do you observe that the app does not recognize touch events? Is some touch event handler you have registered not being called? How many touch event handlers are there? Is there something in the “X” area that has a different touch event handler than whatever is handling touch for the rest of the screen?

Thank you both.

yes, @ingemar, you’re right. I did a new project for test purposes, I’ve just inserted

local rect = display.newRect(870,100,10,10) local function helloWorld() print("Hello World") end rect:addEventListener("touch", helloWorld)

and it doesn’t work! But if I put the rect on the left side of the screen, it works as it should.

@_memo Yes, as you can see from the sample code, there is a touch event that is not being called. that’s the only touch event in the scene and no, the area marked with “X” doesn’t have a different touch event.

local rect = display.newRect(870,100,10,10) means that the rect size is width=10, height=10 located at position x=870 y=100.

Also the anchor points are by default 0.5 which means the center-point of the rect will be positioned at the x,y coordinates given to newRect() 

Yes I know. By the way, let’s say that the screen width is 1200, and the height is 800, if rect.x < 600 (width/2) it works, but If rect.x is > than 600, it won’t. I’ve also tried (using iPhone 4/4s resolution in landscape mode [960x640]) to use a 960x640px image (adding the same event listener as above) and on the right side (the area marked with “X”) it doesn’t perform the event associated. 

OK try this:

local rect = display.newRect(display.contentCenterX, display.contentCenterY, 1200, 800) local function helloWorld() print("Hello World") end rect:addEventListener("touch", helloWorld)

Tried, same as before. I’m using the director class, could be that?

Aha! I believe so.

As far as I know, the director class isn’t Graphics 2.0 compatible. (I’ve never used it myself)

yes director is the problem
if you search the forum you will find how to get around this

yes director is the problem
if you search the forum you will find how to get around this

Ok thanks anyway :slight_smile:

Thanks Jstrahan! have you got a link to a thread about that?

 

sure but if you don’t learn how to search the forums for answers you gonna run into problems. took me less then a minute to find
http://forums.coronalabs.com/topic/43375-touch-events-in-graphic-20/

yes sorry you’re right, infact as soon as I asked you I’ve started to search around the forum and find some useful threads (including the one you’ve posted). Thanks anyway!

It’s not possible to tell without some sample code.

BTW, do you see the same problem if you run one of the Corona samples (or other apps)?

If you do, then you might have a digitizer problem.

How do you observe that the app does not recognize touch events? Is some touch event handler you have registered not being called? How many touch event handlers are there? Is there something in the “X” area that has a different touch event handler than whatever is handling touch for the rest of the screen?

Thank you both.

yes, @ingemar, you’re right. I did a new project for test purposes, I’ve just inserted

local rect = display.newRect(870,100,10,10) local function helloWorld() print("Hello World") end rect:addEventListener("touch", helloWorld)

and it doesn’t work! But if I put the rect on the left side of the screen, it works as it should.

@_memo Yes, as you can see from the sample code, there is a touch event that is not being called. that’s the only touch event in the scene and no, the area marked with “X” doesn’t have a different touch event.