Author Topic: Anchored clipping  (Read 1606 times)

Lumos

  • Newbie
  • *
  • Thank You
  • -Given: 7
  • -Receive: 4
  • Posts: 21
    • View Profile
Anchored clipping
« on: May 07, 2014, 11:21:01 AM »
Greetings.
This is my first ever post on here, and I hope this is the correct board. If it's not, please excuse me.

In any case, I am relatively new to NGUI, but I reckon I've gotten the hang of it now. So, the whole point is to make resolution-independent UIs, right? I'm working on my main menu, and it would seem that in order to create scrollable panels, I need to define a fixed "clipping rectangle" of sorts, which is not fit at all for my UI which is entirely dependent on anchors. Is there a way I can force an entire widget to act as a "clipper", or to give anhorcs to the clipping rect, or anything? How would one create a completely resolution-independent UI if I can't create non-fixed scrollable views?
(In context, i.e. why I need to have an anchored clipping rect: My "options" screen on the main menu slides into view from the right-hand side, and therefore the clipping rect appears in a different spot whilst editing it than where it is during run-time. My "sliding" was done through forcibly hacking the sliding panel's anchors' absolutes and then tweening them when needed - it's probably entirely incorrect, but I couldn't find a way to do a sliding panel (I'm a noob), so this could be the source of my problems)

Any help will be greatly appreciated!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Anchored clipping
« Reply #1 on: May 08, 2014, 01:48:52 AM »
Both UIWidget and UIPanel derives from UIRect, and it's the UIRect that has anchors. Clipping area is just another way of visualizing the rectangle. This rectangle can be anchored same way as it's anchored on the widget. When you use TweenPosition it will adjust the anchored content the same whether it's UIPanel or UIWidget. Also make sure that your Game View is visible, and isn't hidden behind your Scene View.

Lumos

  • Newbie
  • *
  • Thank You
  • -Given: 7
  • -Receive: 4
  • Posts: 21
    • View Profile
Re: Anchored clipping
« Reply #2 on: May 08, 2014, 09:49:19 AM »
Whoops. Seems that I'm a bloody moron for not noticing obvious behaviour.
Oh well, more proof that one shouldn't do work late at night. :D

Thanks for the swift response, all issues have been resolved.