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
0
Question by TCD · Jun 20, 2015 at 12:19 PM · guibuttonpanel

Can't resize properly

I have a panel, which has a bunch of buttons as Child, i want the panel to resize so that the buttons fit perfekt. but if i asign a conten size fitter it just shrinks the panel to nearly nothing, i tried to add a vertical layout group, which causes the buttons be tottaly deformed. then i tried to turn of the child expansion, but that shrinks my buttons to nearly nothing.

How can i resize the Panel to fitt the buttons without destroying the burrons ?

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
0

Answer by HammerCar · Jun 20, 2015 at 12:31 PM

You simply have to make the anchor of your gui elements the size of that gui element. Then they should resize properly.

Comment
Add comment · Show 5 · 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 TCD · Jun 20, 2015 at 01:00 PM 0
Share

I can only set the ankors to the size of the panel not the button himself and i did not change anything

avatar image HammerCar · Jun 20, 2015 at 05:07 PM 0
Share

If you parented the button to the panel the anchor has to be in the panel. You can still parent it to the canvas, then resize the anchor and then parent it back to the panel. I think that should work.

avatar image TCD · Jun 20, 2015 at 07:22 PM 0
Share

If i make to child of the canvas it sets the anker to the borders of the canvas and if i make it a child of the panel again it resizes to the border of the panel agien :(

avatar image HammerCar · Jun 20, 2015 at 08:42 PM 0
Share

Parent it to the canvas, then resize the anchor to be the size of the gui element, then parent it back to the panel.

To resize the anchor click and hold on one of the anchor things and drag it as close to the gui elements corner as you can. Do this for all of the corners. Then go to the inspector and set the right, left, top and bottom values to 0.

avatar image TCD · Jun 20, 2015 at 09:12 PM 0
Share

If i set the values to 0 my buttons get deformed

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

22 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

Related Questions

Button onClick events will not be triggered 1 Answer

In game right click menu 1 Answer

Clicking Trigger 1 Answer

gui text button dont work 1 Answer

How to make a or array of GUI.Button's? 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