Welcome,
Guest
. Please
login
or
register
.
April 29, 2026, 07:56:20 AM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Detecting whether or not a UITexture is completely on screen?
« previous
next »
Print
Pages: [
1
]
Author
Topic: Detecting whether or not a UITexture is completely on screen? (Read 4419 times)
duggo42
Newbie
Thank You
-Given: 1
-Receive: 0
Posts: 3
Detecting whether or not a UITexture is completely on screen?
«
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!
Logged
duggo42
Newbie
Thank You
-Given: 1
-Receive: 0
Posts: 3
Re: Detecting whether or not a UITexture is completely on screen?
«
Reply #1 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.
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: Detecting whether or not a UITexture is completely on screen?
«
Reply #2 on:
May 14, 2015, 06:16:56 PM »
Have a look at UIPanel.IsVisible(a, b, c, d).
Logged
duggo42
Newbie
Thank You
-Given: 1
-Receive: 0
Posts: 3
Re: Detecting whether or not a UITexture is completely on screen?
«
Reply #3 on:
May 14, 2015, 06:43:44 PM »
Will do. Thanks!
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Detecting whether or not a UITexture is completely on screen?