Author Topic: Set Manual Height with Scaling style:FixedSizeOnMobiles  (Read 3240 times)

Source154

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Set Manual Height with Scaling style:FixedSizeOnMobiles
« on: March 02, 2014, 03:22:06 PM »
HI, i am starting with NGUI and i have problem with setting manual height in UIRoot. I am working on resolution 960x640.
Three "topLeft" buttons are children of TopLeft anchor. Two "topRight" buttons are children of TopRight anchor.
First picture is correct.



On second picture, i set editor resolution on 1024x768. It is wrong because "topLeft" and "topRight" buttons are touching.



On third picture, i set editor resolution on 1024x768 and manualHeight i set by code ...GetComponent<UIRoot>().manualHeight = Screen.height, what was 694;
Buttons are still touching.
It looks like UIRoot or UIPanel was not refreshed.


But when i scaled editor Game window, something updated, i don't know what, but it looks great and i want it.
What i need to call after setting manualHeight? :'(

Source154

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Re: Set Manual Height with Scaling style:FixedSizeOnMobiles
« Reply #1 on: March 02, 2014, 05:34:20 PM »
Maybe i solved this problem by unchecking "Run only once" at all anchor.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Set Manual Height with Scaling style:FixedSizeOnMobiles
« Reply #2 on: March 02, 2014, 09:35:50 PM »
I would advise you to use the new layout system instead of the old UIAnchor. All widgets have anchors built into them now.