Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: moghes on May 15, 2014, 09:40:48 AM

Title: How to set scroll view clipping dynamically?
Post by: moghes on May 15, 2014, 09:40:48 AM
Hello,

I have a scroll view where the clipping (soft clip) is different on every device depending on the resolution.
I tried to access the value via script, but it seems its never reachable.

Any hints concerning this issue?

Thanks.
Title: Re: How to set scroll view clipping dynamically?
Post by: ArenMook on May 15, 2014, 12:04:11 PM
What do you mean? UIPanel.clipSoftness lets you  set it.
Title: Re: How to set scroll view clipping dynamically?
Post by: moghes on June 02, 2014, 04:41:00 AM
Thx Aren,

I want to access the clip size, not the clip softness.

scrollView.GetComponent<UIPanel> ()

as I press the dot, I can find clipOffset and clipSoftness, but there's not variable to set the clip size.

In my case , I want it to be 950 on Ipad, and 1050 on sasumng note 10.1 ..
I must be able to do something like  scrollView.GetComponent<UIPanel> ().clipsize = new Vector2 (Screen.width * 0.88f , screen.height * 0.4f) ;

please help :)
Title: Re: How to set scroll view clipping dynamically?
Post by: moghes on June 02, 2014, 04:53:16 AM
:D

Found the solution :)

scrollView.GetComponent<UIPanel> ().baseClipRegion = new Vector4 (0, 0, Screen.width * 0.82f , Screen.height * 0.75f);

Thanks anyways :)