Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
4
Question by fusecore · Oct 02, 2014 at 12:42 PM · uipixel4.6aspect ratioalignment

Preserve aspect ratio of UI elements, not just image inside it. (4.6 UI system)

Hi, I'm trying to work out a UI with the new UI system in Unity 4.6 Beta. But I can't seem to get it to scale in the way that I want.

I have a UI set up as I want it, as you can see in the screenshot. Now I want to make it scale with the display. Right now as I get a bigger resolution, the interface eventually becomes a tiny dot in the top right corner.

So I tried adjusting the anchor of my panel which has the wood as a background image to stretch with the right side. BUT, as I have conserve aspect ratio turned on, the items in it don't receive the correct information. ( see screenshot 2) Try as I might, I cannot seem to get the right setup of anchors and pivot points to have the items in my inventory to move along with the boxes.

Is there a way to or a different UI element that keeps the rect fixed to the image inside it? So not just keep the aspect ratio of the image inside it, but of the entire element.

[1]: /storage/temp/33204-unityissue2.jpg

unityissue1.jpg (315.1 kB)
unityissue2.jpg (54.5 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

2 Replies

· Add your reply
  • Sort: 
avatar image
3
Best Answer

Answer by lioralterman · Oct 06, 2014 at 11:08 AM

You have to drag only the bottom left triangle of the anchor point like in this image: and then it will resize according to the resulotion.

alt text


33203-unityissue3.jpg (310.0 kB)
Comment
Add comment · Show 1 · 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
avatar image Bmandk · Oct 15, 2014 at 05:23 PM 0
Share

Is there any way to do this easily? I'm thinking like a button to do this for you or anchor mode?

avatar image
1

Answer by Umresh · Dec 27, 2014 at 09:55 AM

You can click on the Left box in Rect Transform which shows the anchor points and select the stretch if you want to resize the image on other resolutions.

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Move gameobject to button in new 4.6? 0 Answers

Align texture on object? 3 Answers

Can't change UI Button Listeners 1 Answer

[4.6] Toggle/Checkbox On/Off 1 Answer

Button is not selectable when pressing the submit button even though it is highlighted. How do I fix that? 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