Author Topic: EDIT: Is "Sticky Press" a global setting?  (Read 2326 times)

GarthSmith

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
  • Games. Math. Code.
    • View Profile
    • Garth Smith's Website
EDIT: Is "Sticky Press" a global setting?
« on: September 13, 2013, 02:23:41 PM »
Hello!

I am trying to implement a simple left/right directional pad on a mobile device. I have two buttons, and currently when I press the left button and "slide" my thumb to the right button, the left button stays in the "Pressed" state while the right button does not register anything.

OnHover events do not get generated on touch devices.
OnPress(true) is not sent when sliding a touch over a button. Only if the touch starts on the button.
OnPress(false) is not send when sliding a touch off a button. Only when the touch ends anywhere on the screen.

Is there some way I can tell if a touch slides over a button and then slides off? I don't see anything I can use at http://www.tasharen.com/?page_id=160 .

Should I use Input.touches[index].position and RayCast from the camera myself thus completely bypassing NGUI for this case?

- Garth Smith
« Last Edit: September 19, 2013, 07:32:36 PM by GarthSmith »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: How to tell when touch moves off a button?
« Reply #1 on: September 13, 2013, 10:24:28 PM »
Uncheck "sticky press" on your UICamera.

GarthSmith

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
  • Games. Math. Code.
    • View Profile
    • Garth Smith's Website
Re: How to tell when touch moves off a button?
« Reply #2 on: September 14, 2013, 11:36:56 PM »
That was easy. Thanks!

GarthSmith

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
  • Games. Math. Code.
    • View Profile
    • Garth Smith's Website
Re: How to tell when touch moves off a button?
« Reply #3 on: September 19, 2013, 07:31:57 PM »
Hello! I have another issue here.

I have two Cameras on two different layers. A ButtonCamera and a MenusCamera. If "Sticky Press" is checked on the MenusCamera and unchecked for the ButtonCamera, the ButtonCamera still acts like sticky press is checked.

All objects under the cameras are on the same layer as those cameras. Event Receiver Mask and Culling Mask are both set to their respective layers.

Is sticky press a global setting? As in if a single camera has sticky press enabled, all cameras act as if sticky press is active?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: EDIT: Is "Sticky Press" a global setting?
« Reply #4 on: September 20, 2013, 03:41:36 AM »
Sticky press on the first UICamera to draw is the one that gets considered. Settings on other cameras are ignored.

GarthSmith

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
  • Games. Math. Code.
    • View Profile
    • Garth Smith's Website
Re: EDIT: Is "Sticky Press" a global setting?
« Reply #5 on: September 20, 2013, 04:03:57 PM »
Thanks for the clarification!
 - Garth Smith

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: EDIT: Is "Sticky Press" a global setting?
« Reply #6 on: September 20, 2013, 04:26:12 PM »
As a sidenote, 3.0 actually hides the properties on UICameras if they're not the primary one.