Author Topic: OnPress doesnt return false  (Read 3156 times)

charaldooo

  • Guest
OnPress doesnt return false
« 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.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: OnPress doesnt return false
« Reply #1 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.

dreamora

  • Guest
Re: OnPress doesnt return false
« Reply #2 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')

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: OnPress doesnt return false
« Reply #3 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.

charaldooo

  • Guest
Re: OnPress doesnt return false
« Reply #4 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?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: OnPress doesnt return false
« Reply #5 on: October 01, 2012, 04:25:29 PM »
The first button will receive both OnPress(true) and OnPress(false).

charaldooo

  • Guest
Re: OnPress doesnt return false
« Reply #6 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