Click event pass through a button and clicked the PickerWheel behind the button

  1. I create a PickerWheel first

  2. Then create a button on top of the PickerWheel (Button at frontend and overlap the PickerWheel at backend)

  3. Click the button, the button receive the click event, but the PickerWheel also receive the click event too

My question:

How to only let the button receive the click event, and not let the behind PickerWheel receive the click event?

Try returning true on callback event.

local function buttonListener(e)      return true end

Any touch/tap layer can be blocked the way Maciej describes above.

Sometimes when I want to open a dialogue windows, it can be helpful to first create a transparent full screen texture which has isTouchEnabled set to true. Then make two listeners that both point to a block function like the one above. Sometimes this texture listeneres can be used to catch the typical “press outside area to cancel or return” functionality we are all so used to these days.

Anything created after this “blocker” is layered on top.

Cheers!

I tried this way, but still the backend PickerWheel received the click event if I just click the button in the frontend

:( 

Try returning true on callback event.

local function buttonListener(e)      return true end

Any touch/tap layer can be blocked the way Maciej describes above.

Sometimes when I want to open a dialogue windows, it can be helpful to first create a transparent full screen texture which has isTouchEnabled set to true. Then make two listeners that both point to a block function like the one above. Sometimes this texture listeneres can be used to catch the typical “press outside area to cancel or return” functionality we are all so used to these days.

Anything created after this “blocker” is layered on top.

Cheers!

I tried this way, but still the backend PickerWheel received the click event if I just click the button in the frontend

:(