# Widget. How can I make transparent parts of button unclickable?

**URL:** <https://forums.unrealengine.com/t/widget-how-can-i-make-transparent-parts-of-button-unclickable/377890>\
**Category:** UI\
**Tags:** buttons, unreal-engine, transparency, Widget, Blueprint, question\
**Created:** [November 30, 2016, 9:57am UTC](https://forums.unrealengine.com/t/widget-how-can-i-make-transparent-parts-of-button-unclickable/377890 "2016-11-30T09:57:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Discozy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Discozy](https://forums.unrealengine.com/u/Discozy)\
**Post date:** [November 30, 2016, 9:57am UTC](https://forums.unrealengine.com/t/widget-how-can-i-make-transparent-parts-of-button-unclickable/377890/1 "2016-11-30T09:57:02Z")

</div>

I have a button. When I click this button it adds 5 to the score. I use an image for this button and this image has a transparent parts. When I click on transparent parts it still adds 5 to the score. How can I achieve that when I press only on the visible part of the image it fires on click event?

---

<div class="post-metadata">

**Author:** ![anon87572638](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anon87572638](https://forums.unrealengine.com/u/anon87572638)\
**Post date:** [November 30, 2016, 11:26am UTC](https://forums.unrealengine.com/t/widget-how-can-i-make-transparent-parts-of-button-unclickable/377890/2 "2016-11-30T11:26:02Z")

</div>

I don’t think you can just per sé. The clickable area of a button is defined by the dimensions in the WidgetBlueprint and not by the transparency of a button’s image. So what you can do is create an extra Image under your button. If you then make the button texture fully transparent, and the scaling of the button quite small, you should get the desired effect. Yet, as far as I know, there is no thing as button masking. But i could be wrong here.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e4e550c6](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e4e550c6](https://forums.unrealengine.com/u/anonymous_user_e4e550c6)\
**Post date:** [November 30, 2016, 1:36pm UTC](https://forums.unrealengine.com/t/widget-how-can-i-make-transparent-parts-of-button-unclickable/377890/3 "2016-11-30T13:36:50Z")

</div>

try this: go to the image that you are using and double click on it, this will open the image property, under “Level of Detail” (on the left panel) change the texture group to “UI”. and under “Compression” change the compression settings to “UserInterface2D (RGBA)” this will enable the Alpha channel (the transparent part) on your image.  
second: inside your widget … select the button and under “Style” make sure the “draw as” is set to “image” for each state (Normal, Hovered, Pressed … etc.)

---

<div class="post-metadata">

**Author:** ![Discozy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Discozy](https://forums.unrealengine.com/u/Discozy)\
**Post date:** [December 1, 2016, 8:57am UTC](https://forums.unrealengine.com/t/widget-how-can-i-make-transparent-parts-of-button-unclickable/377890/4 "2016-12-01T08:57:33Z")

</div>

Unfortunately, it still fires OnClickEvent when I click on the transparent part of the image.

---

<div class="post-metadata">

**Author:** ![Discozy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Discozy](https://forums.unrealengine.com/u/Discozy)\
**Post date:** [December 1, 2016, 7:11pm UTC](https://forums.unrealengine.com/t/widget-how-can-i-make-transparent-parts-of-button-unclickable/377890/5 "2016-12-01T19:11:00Z")

</div>

I couldn’t find any other way to make it work. I’ve just made some transparent buttons to cover my image and that works.

---

<div class="post-metadata">

**Author:** ![Arda\_TR\_671](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Arda\_TR\_671](https://forums.unrealengine.com/u/Arda_TR_671)\
**Post date:** [March 12, 2023, 8:52pm UTC](https://forums.unrealengine.com/t/widget-how-can-i-make-transparent-parts-of-button-unclickable/377890/6 "2023-03-12T20:52:04Z")

</div>

any solution ?
