1
NGUI 3 Support / Re: Making the contents of a ScrollView relative to screen size?
« on: March 13, 2014, 09:09:26 AM »
I've found a workaround:
For the shaded background you see, I simply script it to be:
GetComponent<UISprite>().SetDimensions((int)scrollView.GetComponent<UIPanel>().width,(int)GetComponent<UISprite>().height);
So that the backgrounds width and height is that of the scrollview's.
Then if i anchor all the buttons to the sides of the background, they will follow, and still be able to scroll through the ScrollView!
Then lastly, I will just have to figure out the aspect ratio between the buttons and the black background, and set the widths/heights accordingly.
For the shaded background you see, I simply script it to be:
GetComponent<UISprite>().SetDimensions((int)scrollView.GetComponent<UIPanel>().width,(int)GetComponent<UISprite>().height);
So that the backgrounds width and height is that of the scrollview's.
Then if i anchor all the buttons to the sides of the background, they will follow, and still be able to scroll through the ScrollView!
Then lastly, I will just have to figure out the aspect ratio between the buttons and the black background, and set the widths/heights accordingly.
