Author Topic: [Mobile] UIButtonScale: sprites already scaled up!  (Read 9872 times)

Lotti

  • Newbie
  • *
  • Thank You
  • -Given: 5
  • -Receive: 0
  • Posts: 47
    • View Profile
[Mobile] UIButtonScale: sprites already scaled up!
« on: October 02, 2014, 05:07:14 AM »
I have verified this bug on android and windows phone but I suppose it is fault of touch detection system.

Well, suppose to use an interface menu composed by windows that slides on screen after player selections (touch). the next window that will slide in, taking place of the old one, will activate UIButtonScale component on each of the sprite, while not being touched, like if it exist a "last touched screen area" memory on NGUI input system that hovers the sprites.

Any idea about how to fix this? On previous version of NGUI i reached this goal commenting OnEnable method on UIButtonScale, but actually [v3.7.3] my fix is not working.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: [Mobile] UIButtonScale: sprites already scaled up!
« Reply #1 on: October 02, 2014, 10:47:10 PM »
I don't quite understand the issue you're describing... a window sliding in will activate UIButtonScale on each sprite while not being touched? Is the touch still active? What events are you receiving?

Lotti

  • Newbie
  • *
  • Thank You
  • -Given: 5
  • -Receive: 0
  • Posts: 47
    • View Profile
Re: [Mobile] UIButtonScale: sprites already scaled up!
« Reply #2 on: October 02, 2014, 11:50:56 PM »
Yes. Let's suppose i am on window (group of buttons) A and i touch the center (x) center (y) button labeled "play". Onclick on that button is triggered so window A will slide offscreen going to the left, and window B will slide in coming from right (with tween positions). Buttons on windows B are 3 placed on a row vertically centered respect the screen. While the tween is going, the left and the center button will tween scale up by themself when they moves under the touched area. The left button finish is animation outside the previuosly touched area and so will tween scale down to original scale, the center one will not because is under the influence of the "previous touched area". Right button will always stay at original scale because it never reach this previous touched area.

I can provide apk (in hours) and a video (in a day, i will be on a makers faire all the weekend). Thank you!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: [Mobile] UIButtonScale: sprites already scaled up!
« Reply #3 on: October 04, 2014, 07:26:17 AM »
A video would help, yes, thank you. You can also do a web player build.

Lotti

  • Newbie
  • *
  • Thank You
  • -Given: 5
  • -Receive: 0
  • Posts: 47
    • View Profile
Re: [Mobile] UIButtonScale: sprites already scaled up!
« Reply #4 on: October 06, 2014, 05:49:08 AM »
https://www.dropbox.com/s/b47yufk57jut8sg/overvolt.mp4?dl=0

see how buttons bump by itself when the "change window" animation is finished :)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: [Mobile] UIButtonScale: sprites already scaled up!
« Reply #5 on: October 06, 2014, 10:37:14 AM »
Put a Debug.Log in UIButtonScale's OnPress and see where it gets called from then. Unless you are using some old version of NGUI, there shouldn't be any OnPress calls. Only OnDragOver/OnDragOut.

P.S. Also make sure you turn off mouse events on UICamera.

Lotti

  • Newbie
  • *
  • Thank You
  • -Given: 5
  • -Receive: 0
  • Posts: 47
    • View Profile
Re: [Mobile] UIButtonScale: sprites already scaled up!
« Reply #6 on: October 08, 2014, 04:15:26 AM »
you were right. It prints only the OnPress events for the touched button, not for the other that appears on the next window.

Switching off the mouse events on the camera is the only solution. Now the defect doesn't occur.

Thank you for your time.