Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by KirschiX · Sep 17, 2015 at 02:23 PM · unity 5uieditorrecttransform

Stacked UI Panels do not position as expected

I want to create two Panels where each fills half of the Canvas. So my idea was to create one big Panel that makes up the desired full size. Then two Panels which are under the big one with anchors 0 - 0.5 and 0.5 - 1. As you can see here:

alt text

Well it does not work as I would expect. The view does indeed display the anchor arrows as expected. But neither the background image (one blue, one yellow) does respect the boundaries, neither does the button in each Panel. The second button should be just left from the center and not on the right side on top of the first one. I do not want to enter absolut pixel values but percentages instead so that the UI looks the same on differently sized screens. What am I doing wrong?

ui.png (44.0 kB)
Comment
Add comment · Show 4
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image ThomasVandenberghe · Sep 17, 2015 at 02:37 PM 0
Share

Have you tried setting the left value to 0, ins$$anonymous$$d of -552? You'll probably need to put some absolute pixel values for padding, otherwise I would suggest taking something like 0.51 as left anchor. You could also try adjust your canvas (CanvasScaler script) to Scale with screen size. I normally use 1024*768 and take iPad as a base resolution, other resolutions will then just add whitespace on the right/left or top/bottom according to the $$anonymous$$atch setting.

avatar image KirschiX ThomasVandenberghe · Sep 17, 2015 at 03:37 PM 0
Share

I did not put that -552 there. As soon as I enter "0.5" for "$$anonymous$$in X Anchor", it automatically sets the left value to 50% of the parent Canvas. I already have my Canvas scaling with screen size. I just want to have two panels where each is 50% width of the parent.

avatar image ThomasVandenberghe KirschiX · Sep 17, 2015 at 03:48 PM 1
Share

It's because when you edit the anchors, it tries to keep the same layout, thus changing the rect transform coordinates. If you change those to 0, it should be 50%.

Show more comments

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Editor Interface Gets Scrambled 0 Answers

UI working fine in editor but glitched in standalone builds 1 Answer

How change speed of scrollbar (ui) with mousewheel 0 Answers

Unable to move UI elements with cursor 0 Answers

Canvas shrinks over time 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges