Author Topic: How to set scroll view clipping dynamically?  (Read 4298 times)

moghes

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 17
    • View Profile
How to set scroll view clipping dynamically?
« 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.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: How to set scroll view clipping dynamically?
« Reply #1 on: May 15, 2014, 12:04:11 PM »
What do you mean? UIPanel.clipSoftness lets you  set it.

moghes

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 17
    • View Profile
Re: How to set scroll view clipping dynamically?
« Reply #2 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 :)

moghes

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 17
    • View Profile
Re: How to set scroll view clipping dynamically?
« Reply #3 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 :)