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!
2 Answers
2What 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?
– fanand20This is done using an Image Mask or UI Mask.
Click Accept on the answer that fixed it for you. If neither, add your own answer and accept it.
– meat5000