Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unity3d new UI: How to set button's interactable zone bigger than the attached image?

Tags:

unity3d

I need it because the image is small and it's difficult to touch it on the mobile device. So I need to have bigger area of interactable zone but the image should stay small.

like image 902
George Avatar asked Mar 07 '15 11:03

George


People also ask

How do I add target graphic to unity?

Just go to "add component" in the inspector, search image, and put that into Target Graphic.


2 Answers

A surprisingly better way (in terms of ease and performance) is to add a text child element, even if you already have one. Leave the text empty and resize it however you like. It doesn't add any alpha.

like image 187
Gio Asencio Avatar answered Oct 25 '22 05:10

Gio Asencio


You need to set it up so that the image is inside a button object. Like this:

enter image description here

This way you can have the Button as big as you want and the Image can be any size. If you don't need the Button background image just make the color transparent in the image componenent of the Button object.

like image 21
hamalaiv Avatar answered Oct 25 '22 06:10

hamalaiv