Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: J450NP13 on November 28, 2013, 12:00:42 AM
-
I have buttons and I need them to stay ont he screen. They can be dragged off screen. Setting up collision isn't going to work...using pyshics isn't going to work.
I notice there's a "restrict within panel" check box, but it doesn't work....unless I am doing it wrong.
How is this suppose to work to keep buttons on the screen???
-
Restrict within panel option works on panels that have clipping set to something other than "None".
If you set up your panel with Invisible clipping, with a UIStretch on that panel that would automatically adjust the clipping to screen's dimensions, and change UIScrollView's Drag Effect to "Momentum" or "None", then you will achieve the effect you're going for.
-
My panels don't have a option for invisible clipping. Just alpha ans soft clip.
-
I set it to alpha clipping and connected the UIstretch, and dragged the panel the buttons are on to the container, is that correct?
But when the buttons get to the edges they just start to go invisible, I need them to stop there.
-
Got it....awesome.
How do I change the size of the panel with code for different resolutions?
-
If you don't have the Invisible option they you don't have the latest version of NGUI. To change the size of the panel, just use UIStretch. It does it for you just like if the panel was a widget. If you want to do it manually, adjust the panel's clipping rect.
-
Well I'm not upgrading now...with my luck it will screw something up.
How do I use the UIStretch??
-
Just attach it to your panel like you would attach it to any widget.