Author Topic: Scaling, anchors and different screen sizes  (Read 3016 times)

JazzMasta

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
Scaling, anchors and different screen sizes
« on: September 23, 2014, 07:26:22 AM »

I want to place a big background texture and a bunch of sprites in a Panel and put that in a UIScrollView, then I want the Panel and its contents to scale so that it always fills upp the left and right sides of the device/screen. So there should be no cropping on the left/right sides, the scrolling content should just exactly fit the width of the device. Is this possible?

Also, when I place objects (sprites) with anchors relative to the background texture, I want to use percent instead of units,
is this possible or is there some other way to place objects to that the follow a scaling background?

thanks



ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Scaling, anchors and different screen sizes
« Reply #1 on: September 23, 2014, 12:33:17 PM »
Sure, it's possible.

If you want a more detailed answer, I suggest you set it up like this:

1. Sprite for the background, anchored how you want it to be (to left/right sides of the screen).
2. Scroll view panel, anchored to the sprite from #1.

For the scaling of content, that's up to you however. NGUI doesn't have that kind of functionality.