Author Topic: How to determine if a widget is clipped out in a scroll-view?  (Read 3707 times)

dandrea

  • Newbie
  • *
  • Thank You
  • -Given: 6
  • -Receive: 2
  • Posts: 23
    • View Profile
How can I probe if widgets are fully outside the clipping area of a clipped (or constrained-but-not-clipped) scroll-view?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: How to determine if a widget is clipped out in a scroll-view?
« Reply #1 on: June 18, 2014, 04:50:20 PM »
Use UIPanel.IsVisible(widget), or if you have a group of widgets -- UIPanel.IsVisible(a, b, c, d) -- corners.

dandrea

  • Newbie
  • *
  • Thank You
  • -Given: 6
  • -Receive: 2
  • Posts: 23
    • View Profile
Re: How to determine if a widget is clipped out in a scroll-view?
« Reply #2 on: June 18, 2014, 05:18:27 PM »
Thanks for the quick reply!

I just tested the UIPanel.IsVisible(widget) method and it works as long as the panel is clipped. If the panel is None or Constrain But Don't Clip, it will report visible no matter what.

Wouldn't be a good idea if Constrain But Don't Clip reported false when the widget is fully outside?

Edit:
By the way, the UIPanel.IsVisible(a, b, c, d) works perfectly.