Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: kalledemos on February 06, 2014, 10:21:41 PM

Title: Set scrollview to specific width
Post by: kalledemos on February 06, 2014, 10:21:41 PM
Is there a way to set a scroll view to be a specific width?  I need it to fill a portion of the bottom of the screen regardless of the aspect ratio.
Title: Re: Set scrollview to specific width
Post by: ArenMook on February 06, 2014, 10:37:10 PM
Anchor the scroll view's panel, or just set its UIPanel.baseClipRegion
Title: Re: Set scrollview to specific width
Post by: kalledemos on February 07, 2014, 11:46:37 AM
Anchoring it seems to work at the start, but when I try to move it at runtime its contents get off centered.
Title: Re: Set scrollview to specific width
Post by: kalledemos on February 07, 2014, 12:44:06 PM
Ok I just used UIStretch.  It seems to work pretty well with UIAnchor to keep it at relative position and width.
Title: Re: Set scrollview to specific width
Post by: ArenMook on February 08, 2014, 03:01:35 PM
Don't use UIAnchor and UIStretch. All panels and widgets have "Anchors" section that you can use instead.

Unless you're on an older version of NGUI.
Title: Re: Set scrollview to specific width
Post by: kalledemos on February 09, 2014, 01:18:29 PM
Do those anchors only run once at initialization, allowing them to be freely moved afterwards?
Title: Re: Set scrollview to specific width
Post by: ArenMook on February 09, 2014, 04:47:07 PM
New anchoring system is persistent. If something is anchored, you can't move it unless you remove the anchor. However tweens still work as expected even if the object is anchored.