Hello,
I was trying to “enlarge” the touch area on some objects and I tried to add a large (transparent) stroke to them, believing that the expanded stroke would receive such touch events, but it looks like it isn’t so, at least not exactly.
I found that on the simulator (didn’t test on a real device) the outer part of the stroke receives the touch (mouse click) only if the touch (mouse cursor) is near the actual object, if the touch is near the outer border of the stroke the touch event is not fired at all.
Am I doing something wrong?
Did anyone else notice this behavior?
I’m using daily build 2015.2576
Here is some code to test: just a 200px red disk with a 200px white semitransparent stroke
io.output():setvbuf("no") -- Avoid console buffering local x,y = display.contentWidth/2,display.contentHeight/2 local radius = 200 local sWidth = radius local disk = display.newCircle(x, y, radius) disk:setFillColor(1,0,0) disk.strokeWidth = sWidth disk:setStrokeColor(1,1,1,0.5) local diskTouch = function (event) print("touch",system.getTimer()) return true end disk.touch = diskTouch disk:addEventListener("touch", disk)