[Resolved] Remove listeners from ui buttons

Is there a way to remove an event listener from a ui button, so that when you show your pause menu or something you aren’t able to hit a button? [import]uid: 147322 topic_id: 27459 reply_id: 327459[/import]

You’d be better off setting focus on your pop up menu or, as I’ve seen done in the past, a transparent rectangle with a blank touch event that returns true.

Peach :slight_smile: [import]uid: 52491 topic_id: 27459 reply_id: 111635[/import]

so perhaps something like this?

function pause()  
local pauseBox=display.newRect(0,0,500,500)  
display.getCurrentStage():setFocus(pauseBox)  
end  

Of course, it would be much more advanced, but would that be the beginning idea? [import]uid: 147322 topic_id: 27459 reply_id: 111656[/import]

Or if you are using storyboard you can just use storyboard.showOverlay and that will prevent touches from leaking through [import]uid: 84637 topic_id: 27459 reply_id: 111696[/import]

@peach:

I tried both of those, and the pause screen is working, but now what I want to do is only ‘turn off’ certain buttons. I tried your idea of making a blank touch event with return true go to a ‘screener’, but it didn’t seem to work. Why? [import]uid: 147322 topic_id: 27459 reply_id: 111721[/import]

Resolved! [import]uid: 147322 topic_id: 27459 reply_id: 111859[/import]

Glad to hear it, marked as resolved :slight_smile: [import]uid: 52491 topic_id: 27459 reply_id: 111908[/import]