Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: duggo42 on May 13, 2015, 10:00:00 PM

Title: Detecting whether or not a UITexture is completely on screen?
Post by: duggo42 on May 13, 2015, 10:00:00 PM
Hey Everyone,

I'm trying to make a draggable camera only active when the user has zoomed in enough that a particular UITexture no longer completely fits on the screen.  Is there a way to detect when any of the UITexture's edges are no longer visible by the camera?

Thanks in advance!
Title: Re: Detecting whether or not a UITexture is completely on screen?
Post by: duggo42 on May 14, 2015, 05:17:21 PM
Okay, I just attached a collider to it and used the collider's bounds to get this information through Camera.WorldToViewportPoint().

If anyone knows if it's possible just through NGUI functions, it'd be cool to hear.
Title: Re: Detecting whether or not a UITexture is completely on screen?
Post by: ArenMook on May 14, 2015, 06:16:56 PM
Have a look at UIPanel.IsVisible(a, b, c, d).
Title: Re: Detecting whether or not a UITexture is completely on screen?
Post by: duggo42 on May 14, 2015, 06:43:44 PM
Will do. Thanks!