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
3
Question by Aladine · Dec 20, 2014 at 12:30 AM · ui4.6anchor

[4.6 UI] how to move a button *AND* its anchors ?

Hello Everyone, Am still not used to the new UI framework and and kinda a bit confused on how anchors work, for now i want to know if there is a way to make the anchors move relatively to their "owners" not the parent of the game object, in the GIF below i move the button and then was forced to move each of the anchors manually, is there a solution for this ? alt text

PS: i can move anchors and button at the same time using the shift button, but only when the anchors are all "connected" together, what i need is to make the anchor stretched on the actual game object (i don't know why when i choose the preset streched option it stretch the anchors to the parent)

Thank you

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 Kiwasi · Dec 20, 2014 at 01:47 AM 0
Share

There are a couple of little buttons on the RectTransform component that may help

3 Replies

· Add your reply
  • Sort: 
avatar image
-2
Best Answer

Answer by Yasser34 · Dec 20, 2014 at 04:08 AM

Hi, you can put your button inside a panel then add a Layout to this panel, ex: "VerticalLayout" : like this the button will be fixed with the Anchors also, and the job is done.

Comment
Add comment · Show 4 · 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 Aladine · Dec 20, 2014 at 06:02 PM 0
Share

my button is already inside a panel, but what do you mean apply a Layout to this panel ? where can i do that ? for now i am using the solution in this question because that is what i need but i wonder why such a basic thing isn't available till now

avatar image Yasser34 · Dec 20, 2014 at 10:28 PM 0
Share

So go to your panel and click : Add Component -> Vertical Layout Group. Yes this solution may help you i hope, when you add your Layout, go click on Padding so like this you can configure the paddings of your panel contents.

avatar image Aladine · Dec 20, 2014 at 10:53 PM 0
Share

Thank you!! that was very helpful, but still there is a new problem now, when i run the game with "maximized on play" enabled, i get a wrong layout, also when i build and test on mobile, however if i run the game un-maximized, then enable that option again and pause->un-pause, everything is in its place, any idea please ?

avatar image Yasser34 · Dec 21, 2014 at 12:23 AM 0
Share

So yes, that's normal : go check your Panel's rectTransform and change the relative resolution ex: if you want to stay on the top of your screen you have to check the top resize rectangle, before you do any build try to change on different resolutions in the game screen like this you can see how it will be on all of your devices.

The most important thing is that you must go verify and activate also on your canvas the auto-resize option : like this your canvas will be resized automatically with the output screen.

avatar image
4

Answer by Sergey_Suslov · May 28, 2019 at 07:33 AM

Hold Crtl and Shift then drag anchor

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 FrickinSilly · Mar 05 at 08:56 PM 0
Share

This works but only if the pivot isn't sitting on top of the anchor. I have to move the pivot, then the object, then place the pivot back.

avatar image
2

Answer by Develax · Feb 27, 2020 at 01:00 PM

Place the anchors to the center of the button, for example.

Then press Ctrl+Shift and drag one of the anchors slowly by mouse, this way everything (button and all its anchors) will be dragged simultaneously.

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

32 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

Related Questions

[Unity 4.6 Beta] Anchor snap to button (New UI System) 3 Answers

Showing text on top of a Slider, but not blocking Handler? 1 Answer

Android screen is small? 0 Answers

4.6 Button OnClick Super Sensitive to pointer movement. 1 Answer

Unity 4.6 - Detect Touch On Screen 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