Author Topic: UIPanel size (no clipping) and UIAnchor  (Read 3887 times)

imteractive

  • Guest
UIPanel size (no clipping) and UIAnchor
« 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)?

Malzbier

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 93
    • View Profile
Re: UIPanel size (no clipping) and UIAnchor
« Reply #1 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.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIPanel size (no clipping) and UIAnchor
« Reply #2 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.

imteractive

  • Guest
Re: UIPanel size (no clipping) and UIAnchor
« Reply #3 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?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIPanel size (no clipping) and UIAnchor
« Reply #4 on: March 05, 2013, 02:12:48 PM »
You can try setting the UIRoot to have a fixed size.