Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: beermoney on August 11, 2014, 10:11:57 AM

Title: scrollviews and content origin
Post by: beermoney on August 11, 2014, 10:11:57 AM
Hi,

I have a scrollview that is ancorhed to the UI root. I find that the content origin is not updating when I change the screen width/height.  Content origin only updates the transform of the scrollview when the user changes it in the editor.

See attached scene/project for example.

Thanks
Title: Re: scrollviews and content origin
Post by: Trance_Trap on August 12, 2014, 12:02:38 AM
Why don't you just Child the scroll view to an empty and write a simple script to move the parent emptys' transform around
when events happen?

Thats what I would do. Then just change scroll view's .localPosition(Vector3 pos) when you want to change its' origin.
Title: Re: scrollviews and content origin
Post by: beermoney on August 12, 2014, 01:53:33 AM
May end up having to make a work around for this but it really is a bug in NGUI. If there's an option to set the contents origin then that should just work. Note that when playing, if the user drags the contents of the scrollview it then will set the contents origin to where it should be.
Title: Re: scrollviews and content origin
Post by: ArenMook on August 12, 2014, 07:04:47 AM
Anchors don't interact with the content origin. If you add a scroll bar there, it will reset it for you though.