remove transparent part of image Button!!?

Hello every body
i have circle Button…
and i want remove transparent part of image Button!!
(because i want Button working properly just clicked on image!)(without any transparent)
picture:

HOW?
please help!and thanks for helping!

Click Accept on the answer that fixed it for you. If neither, add your own answer and accept it.

2 Answers

2

What you want is this

https://docs.unity3d.com/ScriptReference/UI.Image-alphaHitTestMinimumThreshold.html

Make a script that changes alphaHitTestMinimumThreshold (For the Image component that your button uses) at start, to something other than 0 (Like 0.5f). Then the transparent parts of the image won’t trigger the button when you click on them.

Hi my friend.../this code not work for me:/ please help! my unity version is 5.5.1! how use this code!.......................................i normal use & not working! ................................................ public Image theButton; void Start() { theButton.alphaHitTestMinimumThreshold = 0.5f; } //why?

THats WORK!thank youuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu

This is done using an Image Mask or UI Mask.

https://www.google.co.uk/search?q=unity+non+clickable+image+mask&ie=utf-8&oe=utf-8&client=firefox-b&gfe_rd=cr&dcr=0&ei=H8XIWqeTOomq8weVrofYCw

my problem fixed!thank you