Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: imteractive on March 05, 2013, 11:26:27 AM

Title: UIPanel size (no clipping) and UIAnchor
Post by: imteractive on March 05, 2013, 11:26:27 AM
Hi,

In my game menu I want to have several different pages (splash, options, game modes, etc). For each "page" I have a UIPanel and those pages enter and exit camera view as needed.

The problem is that some page elements have to be relatively positioned (top left, bottom right, etc) to those pages using the UIAnchor. Unfortunately I can't seem to be able to control the UIPanel size (purple border) unless I use clipping.

Is there a way to make the UIPanel size match the screen size in all resolutions (and without clipping)?
Title: Re: UIPanel size (no clipping) and UIAnchor
Post by: Malzbier on March 05, 2013, 11:50:44 AM
That would be very nice !

My workaround was: Create a UISprite attach the UIStrech and UIAnchor and set the UIAnchor to the Panel. Set the UIStretch to style both directions and now you can use the position relative to the UISprite (Witch you should probably deactivate so that it does not show) . I now, its not very clean but it helped me out.
Title: Re: UIPanel size (no clipping) and UIAnchor
Post by: ArenMook on March 05, 2013, 12:50:59 PM
The purple border will match the screen size if it's not clipped, so I am not sure what you're asking.
Title: Re: UIPanel size (no clipping) and UIAnchor
Post by: imteractive on March 05, 2013, 01:04:18 PM
You're right ArenMook!

Since I'm testing in the editor and I don't have a full-size window game preview, the UIPanel grabs whatever size I have in there. Is there a workaround so I can see how it looks without deploying to device?
Title: Re: UIPanel size (no clipping) and UIAnchor
Post by: ArenMook on March 05, 2013, 02:12:48 PM
You can try setting the UIRoot to have a fixed size.