Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: tonyM on September 10, 2013, 05:53:25 PM

Title: Is UISprite rendered on screen (Or in screen bounds)
Post by: tonyM on September 10, 2013, 05:53:25 PM
Hi guys,

I have a moving sprite on screen.  Is there any way how I can check if it moved off screen bounds please?

Thanks.
Title: Re: Is UISprite rendered on screen (Or in screen bounds)
Post by: ArenMook on September 11, 2013, 08:01:27 AM
NGUITools.CalculateAbsoluteWidgetBounds gives you the bounds. Get the min/max points and convert them to screen space. Check to see if they're both off-screen.
Title: Re: Is UISprite rendered on screen (Or in screen bounds)
Post by: tonyM on September 11, 2013, 03:45:43 PM
Thanks for that.

Actually it was NGUIMath.CalculateAbsoluteWidgetBounds(go.transform);