Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: vexir on October 01, 2014, 05:28:06 PM
-
UIButtonScale seems to affect the collider's scale as well. This results in issues where the scaling causes the collider to no longer be under the finger and the touch gets thrown out. Is this something that you're aware of?
-
Can't say that I am. What's your setup?
-
NGUI 3.6.3. Might be a little risky to at this stage in the project; though I would if it fixed this. UI Root set to Fixed Size On Mobiles. Standard UIButtons with UIButtonScale script on them. Testers keep trying to press buttons on the edge of collision at which point it drops out and doesn't register as a press.
-
Another note - you can tell it happens because although the button stays scaled, the color reverts back to a non-pressed color.
-
Yeah that's 11 versions behind, can't say much about that.
-
This problem seems still exists in 3.7.6, how to resolve this?
-
So what's the issue exactly? How do I reproduce it?
-
So what's the issue exactly? How do I reproduce it?
If attach a UIButtonScale component to a button, with (1, 1, 1) as 'Hover' property and (0.8, 0.8, 0.8 ) as 'Pressed' property, when I press at edge of the button, the OnPress callback will not be triggered because the collider is no longer under my finger.
-
Oh, well yeah. Collider won't be underneath that button anymore after the scaling operation.
If you want the collider to stay the same size, then you need to separate it from the viewable component like so:
UIWidget (collider, button component)
- Sprite (visible sprite that will scale)