Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: charaldooo on September 28, 2012, 03:25:29 AM

Title: OnPress doesnt return false
Post by: charaldooo on September 28, 2012, 03:25:29 AM
I have a problem with the OnPress event it doesn't return false, if I didn't release the mousebutton on the same trigger as I pressed on.
Is it a bug?
I want it to return false when I release the button elsewhere too.
Title: Re: OnPress doesnt return false
Post by: ArenMook on September 28, 2012, 12:10:27 PM
"return" a false? OnPress has a boolean parameter that's true or false depending on whether it was pressed or released.
Title: Re: OnPress doesnt return false
Post by: dreamora on September 29, 2012, 10:28:44 AM
I think what he meant is that OnPress is not fired with 'false' when you drag a pressed finger out of a widget ('does not return false when release of button is not on the same widget as the down')
Title: Re: OnPress doesnt return false
Post by: ArenMook on September 29, 2012, 11:14:47 AM
It does though. OnPress(false) is always guaranteed to be sent to the same widget as OnPress(true) unless you manually changed UICamera.currentTouch.pressed to be something else.
Title: Re: OnPress doesnt return false
Post by: charaldooo on October 01, 2012, 03:37:01 AM
Do I get OnPress(false) if press down my mouse button on a button and release on another button?
Title: Re: OnPress doesnt return false
Post by: ArenMook on October 01, 2012, 04:25:29 PM
The first button will receive both OnPress(true) and OnPress(false).
Title: Re: OnPress doesnt return false
Post by: charaldooo on October 02, 2012, 03:20:06 AM
Thank you for the help =D

I look at my code again and fix the problem.
So there wasn't any problem with OnPress(false)  ;D