• 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 manhboanheo · Aug 14, 2015 at 05:27 PM · uigameobjectbuttonimportimage

Best Button for UnityGame 2D

Hi, I have three question about Button in Unity Game.Please help me. 1) In Unity, the Default button is a Rectangle. How can I change them ? Such as I replace default by a image and It don't fit the size of Default ?alt text

2) Can I create a button by Image ? Give me an example.

Thanks and Best Regards

screenshot-239.png (34.6 kB)
Comment
Add comment · Show 2
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 DwaynePritchett · Aug 14, 2015 at 05:52 PM 0
Share

You should look up some Unity uGUI stuff. Go for 4.6 or later. Youtube vid or the documentation.

-Dwayne Pritchett

avatar image Owen-Reynolds · Aug 14, 2015 at 06:59 PM 0
Share

Try to ask one question at a time, and to add details. Then you can often look it up.

How do you want to change the button rectangle? From the picture, it looks like you just want to change the width. So many look up "unity change button size." It also sounds like you might want a non-rectangular image. Round seems like a common non-rectangular button type, so maybe look up "unity round button."

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Wiki

Answer by itsharshdeep · Aug 14, 2015 at 06:34 PM

Hi,

Reply to your Questions are as per my understandings :-

1) You can't change the default shape of the buttons, but you can take the image with alpha so that It will look like a button ( the way you are displaying in the screenshot are correct, but I don't know that this is only image or button)

2) Now few things like checkBox of Preserve Aspect which you can use for not stretch out the photos or this will also help you to not compress the images ( Your current image is looking like this)

3)Yes you can create a button with your image just add the Following things as displayed in the screenshot.The screenshot I think give you the answer of all your question like your custom image as a button, the components required to use image as a button.

alt text


button.png (60.0 kB)
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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

UI Questions 1 Answer

How to join a specific image to random button...?,Hello everybody, 0 Answers

On Button Click Enable - Disable GameObject Through Inspector 1 Answer

Unity ruins image horribly 3 Answers

New UI Button: Have sprite fill entire button (overflow). 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