Author Topic: Scrolling background with NGUI  (Read 1461 times)


  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 155
    • View Profile
Scrolling background with NGUI
« on: April 15, 2014, 11:39:35 AM »
Any experience with implementing scrolling background with few layers for foreground,midground and background
but with the respect of aspect ratio?

I though about anchoring to root and using height, so it is the same with for all aspect resolutions?
any ideas?

thank you!


  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Scrolling background with NGUI
« Reply #1 on: April 16, 2014, 10:03:44 AM »
Easiest thing to do would be to use a widget who's dimensions in the direction of scrolling is larger than the screen. Most efficient way would be to create a custom widget to do this, likely derived from UITexture and overwriting the OnFill function to have some kind of UV offset that's based on the scroll amount. That, or just modifying UITexture's UV rect from another script.