Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: peaj on October 16, 2014, 03:09:21 AM

Title: Deactivate reposition animation on aspect ratio change
Post by: peaj 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
Title: Re: Deactivate reposition animation on aspect ratio change
Post by: ArenMook on October 16, 2014, 06:50:17 AM
Reposition animation of what?
Title: Re: Deactivate reposition animation on aspect ratio change
Post by: peaj 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.
Title: Re: Deactivate reposition animation on aspect ratio change
Post by: ArenMook 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.
Title: Re: Deactivate reposition animation on aspect ratio change
Post by: peaj 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?
Title: Re: Deactivate reposition animation on aspect ratio change
Post by: ArenMook on October 20, 2014, 11:36:12 PM
It shouldn't. Anchor updates are hierarchical -- dependencies are always updated first.