- Home /
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 ?
2) Can I create a button by Image ? Give me an example.
Thanks and Best Regards
You should look up some Unity uGUI stuff. Go for 4.6 or later. Youtube vid or the documentation.
-Dwayne Pritchett
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."
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.
Your answer
Follow this Question
Related Questions
UI Questions 1 Answer
Buttons become invisible when changing color (on Button or on Image) in script -1 Answers
I want to make responsive homescreen. how to make responsive homescreen UI like this example ? 0 Answers
UI image with collider doesn't work OnMouseDown 1 Answer
Unity ads , can't we show video by clicking a button? 1 Answer