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
1
Question by Fragmental · Mar 06, 2017 at 05:05 AM · uitransformscalerectanchor

Questions about UGUI Rect Transform Anchors. How to make UI objects scale, correctly, with screen?

There's something that's been bothering me about the UGUI ui and the way it works.

I want my objects to scale evenly when the screen scales and the only effective way I've found to do this is to carefully place the anchors, by hand, on the boundaries of the rect transform. Here's an example: alt text

There's really no easy way to do this. There's many ways to control the anchors, but none of them seem to do what I want and none of them accommodate for this. This shows up as custom/custom. And there's no good way in custom mode, like this, to resize the rect in the inspector. Instead of a height or a width there is a left, top, right, and bottom that doesn't really seem to make a lot of sense to me. The anchors min/max x and y don't make a lot of sense to me either.

Example: alt text

If you do move or resize the rect the anchors don't follow and there's no good way, I know of, to move them back to the corners(Edit: I just found uGUI tools script which does exactly that). I think the rect will snap to the anchors, though, but that doesn't really help in moving the rect.

So, am I missing something that would make this all work a lot better for me? Or is this uGUI's intended behavior, it just wasn't well designed for what I want to do?

I guess, for now, unless someone tells me differently, when I want to make a UI object a specific size, I will switch the anchors to a mode that allows that, and then I'll use the uGUI tools script I just found set the anchors back to the corners. Silly that Unity doesn't include that.

anchor-button-example.png (11.0 kB)
rect-inspector.png (33.2 kB)
Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by Zionmoose · Jul 02, 2017 at 05:24 PM

Little late to the game, but you can use something like this. It's a free asset that does exactly as you ask. I use it myself.

https://www.assetstore.unity3d.com/en/#!/content/78730

Comment
Add comment · Share
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

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

107 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Convert Input.mousePosition to RectTransform pivot position 2 Answers

How to change the Top and Bottom (rect.yMin and yMax) properties of a rectTransform, in a script? 2 Answers

Change size of the new UI rect transform using scripts 0 Answers

UI How to configure Left And Right. 1 Answer

Using Unity New UI, duplicated UI objects created with Scale 0, 0, 0 1 Answer


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