Author Topic: Deactivate reposition animation on aspect ratio change  (Read 3382 times)

peaj

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 6
    • View Profile
Deactivate reposition animation on aspect ratio change
« on: October 16, 2014, 03:09:21 AM »
I'm trying to disable the repositioning animation when the aspect ration changes.
On ratio change the Sprites should be instantly positioned at the right place and not move there
smoothly. Is there any way to deactivate it?

Best regards,
Pascal

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Deactivate reposition animation on aspect ratio change
« Reply #1 on: October 16, 2014, 06:50:17 AM »
Reposition animation of what?

peaj

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 6
    • View Profile
Re: Deactivate reposition animation on aspect ratio change
« Reply #2 on: October 16, 2014, 09:54:19 AM »
I mean the repositioning of every anchored UIWidget.
Our UIButtons for example are anchored to the left or right of the UIRoot.
If you start the scene with another resolution than it has been designed with,
the buttons slide to the side until they reach their anchored position.
They shouldn't slider there but just instantly be placed at the anchored position.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Deactivate reposition animation on aspect ratio change
« Reply #3 on: October 17, 2014, 04:51:03 AM »
NGUI doesn't animate anchors smoothly like that. I suggest you examine what else you have on those widgets -- such as tweens.

peaj

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 6
    • View Profile
Re: Deactivate reposition animation on aspect ratio change
« Reply #4 on: October 20, 2014, 03:20:00 AM »
There are no tweens or anything similar.

The Layout consists of:

Buttons (UI2DSprite, UIButton, Box Collider)
Anchored to Widget (UIWidget)
Anchored to Root (UIRoot, UIPanel, Rigidbody)

All anchors are set to OnUpdate.
UIRoot is set to constraint on height.

Could it be that the Sliding comes from NGUI needing several
update cycles to solve the anchors?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Deactivate reposition animation on aspect ratio change
« Reply #5 on: October 20, 2014, 11:36:12 PM »
It shouldn't. Anchor updates are hierarchical -- dependencies are always updated first.