Hello,
I am looking for a way, if possible to zoom in/out to/of the clipped panel's contents.
Now I have done this before by using an external orthographic camera, changing its rect to the area I want to zoom in to, and then mess with its size to zoom in/out. (See attachment)
Now this is OK if I don't wanna interact with the object I'm zooming in/out to/from. Obviously for this to work, I had to make a separate panel for the object in question (the wooden sprite) - Got this info from UIWidget.cs:
public void CheckLayer ()
{
if (mPanel != null && mPanel.gameObject.layer != gameObject.layer)
{
Debug.LogWarning("You can't place widgets on a layer different than the UIPanel that manages them.\n" +
"If you want to move widgets to a different layer, parent them to a new panel instead.", this);
gameObject.layer = mPanel.gameObject.layer;
}
}
But then of course, when you mess around with layers (because I should remove the object I'm zooming in/out layer from my main gui cam culling mask, so that only my external cam sees the object - the wooden sprite), ray might not hit colliders, I had a lot of trouble getting the collider on the wooden sprite to detect mouse clicks, I rarely, in some very unique cases managed to, I was never able to get it work.
Anyway, that's not my question, I was just showing you my attempt to create a zoom in/out effect. I will post in much more detail about the problems I had there in another post.
But right now, since my way of doing it was very tedious, I thought well, NGUI must have something to achieve this, Aren wouldn't let something like this pass by now would he? ;-)
So, is there an NGUIsh way, an elegant way to achieve zooming in/out?
- Thanks all in advance.
EDIT: I have just noticed that messing around with the panel's scale (that has only the wooden sprite) could do the job for me, but of course, messing with a panel scale is a taboo in NGUI

(See other attachment)