Author Topic: Clipped panel with particular shape?  (Read 3697 times)

albertofog

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Clipped panel with particular shape?
« on: October 14, 2013, 05:59:41 AM »
I'm developing a little match-3 game à la Candy Crush, and I'm wondering if it's possible to make a clipped panel that is not a squared/rectangular shape.
I've been looking around the code of the UIPanel script but I can't see anything that could help me achieve it... I use NGUI 2.6.4.
Some examples:
Quote






Does anyone have any ideas?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Clipped panel with particular shape?
« Reply #1 on: October 14, 2013, 09:49:41 AM »
You can use depth marks. Draw an invisible widget on top of the UI in the shape that you want first, and when UI will draw it will get "clipped" by the depth.

albertofog

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Re: Clipped panel with particular shape?
« Reply #2 on: October 15, 2013, 03:48:56 AM »
You can use depth marks. Draw an invisible widget on top of the UI in the shape that you want first, and when UI will draw it will get "clipped" by the depth.

Depth marks?
Hmmm, not entirely sure how to do those :/
When you mean "invisible widget", do you mean a inactive GameObject? Or what do you mean?

I would appreciate some more enlightening on this... thanks in advance!