Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: coolaneasy on September 25, 2014, 03:51:02 PM
-
Hi guys
I basically am going to be getting a callback upon which I want to know whether its within my widget bounds or not.
I did GUIMath.ScreenToPixels (UICamera.lastTouchPosition,alphaPanel.transform)
I guess the numbers this returns could be checked against the widgets pixel width and height but I can't seem to find a way to get that.
Thoughts?
Help appreciated.
Thanks
-
You can add a collider to your widget and activate the Debug option in the UI camera.
-
I meant through code. I'll be having multiple colliders on top of this base collider and hence I can't rely on the mouseout callbacks from the base collider alone.
-
http://www.tasharen.com/forum/index.php?topic=11263.0
-
I actually ended up using the ScreenToPixels and the localCorners on the widget. Seems to work fine so far. The screen to world to local wasn't giving me correct results for some reason(I was passing in the same camera for world and ui. wonder if it was something to do with that).