[Resolved] UI Library

So, it doesn’t matter what I do, I cannot stop touch/tap events dropping through a button created with ui.newButton to the Runtime - simply returning true from all events does not do the job.

How do you stop Runtime event listeners receiving events permeated through from the buttons? [import]uid: 8271 topic_id: 33136 reply_id: 333136[/import]

I thought you just did a “Return True” at the end of the touch/tap function.

Dave [import]uid: 117617 topic_id: 33136 reply_id: 131575[/import]

Doesn’t seem to work and yes, my code is that simple. [import]uid: 8271 topic_id: 33136 reply_id: 131581[/import]

@horacebury, I’m not entirely sure what you mean by “a button created with ui.newButton to the Runtime” or by “Runtime event listeners receiving events permeated through from the buttons”, so this may not help at all – but sometimes when I want a touch or tap to do nothing, I attach doNothing function to touch/tap: [text]local function doNothing() end[/text]. Would it help at all in your case?

Naomi

Edit: BTW, I’d toggle between doSomething and doNothing at runtime (depending on the conditions that require the touch/tap to stop doing something or start doing something.) [import]uid: 67217 topic_id: 33136 reply_id: 131600[/import]

I was barking up the wrong tree, tbh. I should have been using the widget button and not the (very legacy) UI Library button! [import]uid: 8271 topic_id: 33136 reply_id: 131611[/import]

Ah, glad to hear switching to the widget button was all it took to solve it.

Naomi [import]uid: 67217 topic_id: 33136 reply_id: 131614[/import]

I thought you just did a “Return True” at the end of the touch/tap function.

Dave [import]uid: 117617 topic_id: 33136 reply_id: 131575[/import]

Doesn’t seem to work and yes, my code is that simple. [import]uid: 8271 topic_id: 33136 reply_id: 131581[/import]

@horacebury, I’m not entirely sure what you mean by “a button created with ui.newButton to the Runtime” or by “Runtime event listeners receiving events permeated through from the buttons”, so this may not help at all – but sometimes when I want a touch or tap to do nothing, I attach doNothing function to touch/tap: [text]local function doNothing() end[/text]. Would it help at all in your case?

Naomi

Edit: BTW, I’d toggle between doSomething and doNothing at runtime (depending on the conditions that require the touch/tap to stop doing something or start doing something.) [import]uid: 67217 topic_id: 33136 reply_id: 131600[/import]

I was barking up the wrong tree, tbh. I should have been using the widget button and not the (very legacy) UI Library button! [import]uid: 8271 topic_id: 33136 reply_id: 131611[/import]

Ah, glad to hear switching to the widget button was all it took to solve it.

Naomi [import]uid: 67217 topic_id: 33136 reply_id: 131614[/import]