Author Topic: scrollviews and content origin  (Read 7475 times)

beermoney

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 80
    • View Profile
scrollviews and content origin
« 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

Trance_Trap

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 1
  • Posts: 5
    • View Profile
Re: scrollviews and content origin
« Reply #1 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.
One Person can make a difference, and Every Person should Try. ~John F. Kennedy

My avatars' text: "You wouldn't like me when I'm angry... Because I Always backup my rage w/Facts & documented sources" ~The Credible Hulk(he's wearing glasses) ... Lol I just thought it was hilarious ^_^

beermoney

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 80
    • View Profile
Re: scrollviews and content origin
« Reply #2 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.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: scrollviews and content origin
« Reply #3 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.