Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 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 /
This question was closed Nov 09, 2015 at 11:38 PM by dtamas80 for the following reason:

There is no solutions I think...

avatar image
0
Question by dtamas80 · Nov 01, 2015 at 10:28 PM · 2duibuttoncanvas

Changing button positions on different resolutions

Hi there,

Is there any solution for the following problem?

I have canvas, with the following parameters:

Render mode: screen space - camera - UI Scale Mode: Scale with screen size - Ref. resolution: 1280x1920 - Screen match mode: Match width or height

In this canvas, I have an image where the anchor presets setting is strecth to all the directions (like a background image). The image size is 1280x1920 too, but I think this doesn't matter...

And there is a button in the canvas too. I set this button's position to manually based on the image. (There is something on the image, where I want to place the button). The anchor presets setting is middle/center and the position is e.g.: x = 460, y = 730.

And about the problem:

If I changed the screen resolutions, the button's position stays the same (460/730), but it doesn't mean the same what was in the original resolution so the button moves away.

I know why that happens. The image and button anchor's settings are not the same, but I can't use stretch for the button because in that case, the button will be deformed on other screen resulotions.

Is there any way to solve this issue? E.g.: some matemathical way, to calculate new position to the button; or other settings etc.

I hope what I wrote it's understandable...

Thanks for your help.

Comment
Add comment · Show 1
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 badfatcat · Nov 04, 2020 at 11:18 AM 0
Share

I had the same problem, and it was fixed with UI Scale $$anonymous$$ode: Scale with screen size; Screen match mode: Expand

1 Reply

  • Sort: 
avatar image
0

Answer by JackNelson · Nov 01, 2015 at 11:00 PM

Your button isn't linked with your canvas so scaling your canvas won't help, do your best to make sure the button is linked to the canvas.

Comment
Add comment · Show 2 · 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 dtamas80 · Nov 02, 2015 at 06:27 AM 0
Share

When I add a button to the scene, is it not linked automatically to the canvas? If not, how should I do that?

avatar image dtamas80 · Nov 03, 2015 at 05:16 PM 0
Share

I tested it again and unfortunatelly it doesn't work. If I set up different anchor preset for the image and the button the button doesn't stay on the original position when I change the screen resolutions. But when the anchor preset is the same, the button can follow the changes so I think that the button was linked to the canvas as normal.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Problems with render priority in UI Canvas 2 Answers

Canvas Button persistence 0 Answers

Call Functions On Player From Canvas Elements In a Multiplayer Game 1 Answer

Ui elements not scaling correctly 0 Answers

Button doesnt work after reactivating Canvas. 4 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