Author Topic: Strange problem with panel clipping...  (Read 3655 times)

dt1000

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 16
    • View Profile
Strange problem with panel clipping...
« on: January 13, 2015, 11:23:53 PM »
Hi there.
I was using the clipping functionality of NGUI to create a very cool screenwipe effect.
Unfortunately, when I upgraded to the version that does away with hard clipping, this effect stopped working.
Allow me to elaborate...

I have a panel that is anchored to the edges of the screen.
It's clipping is set to Soft Clip (where previously it was Hard Clip).
Inside the panel is a UITexture object, also anchored to the edge of the screen.
To do the wipe I grab a screenshot, apply it to the texture object, then tween the left anchor value of the parent panel to the right edge of the screen.
Previously this worked like a charm to create a sexy wipe... but now the clipping doesn't seem to kick in.

BUT WAIT!!! This is where it gets weirder...

I noticed that if I flipped the panels clipping from Soft to Texture and back again, in the editor while the game is running, the clipping starts working.
BUT... if I try doing that in code (as a hacky workaround) it does nothing.

This feels like a bug to me... or am I doing something wrong? Does Soft Clip have some particular foible that might be causing this? Is there a way I can go back to Hard Clip?

Any suggestions would be most welcome!

Thanks,
Dan

dt1000

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 16
    • View Profile
Re: Strange problem with panel clipping...
« Reply #1 on: January 13, 2015, 11:46:27 PM »
A few minutes after I posted this... I found the answer here!
http://answers.unity3d.com/questions/300955/ngui-panel-clipping-with-textures.html

The shader for the material on the UITexture needed to be "Unlit/Transparent Colored".

Yay!

 8)