x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

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

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?

Product Version: UE 4.14
Tags:
more ▼

asked Nov 30 '16 at 09:57 AM in Blueprint Scripting

avatar image

Discozy
19 7 6 8

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

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.

more ▼

answered Nov 30 '16 at 11:26 AM

avatar image

Nico90
68 6 7 11

avatar image Discozy Dec 01 '16 at 07:11 PM

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.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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.)

more ▼

answered Nov 30 '16 at 01:36 PM

avatar image

RammaLi
66 1 4 6

avatar image Discozy Dec 01 '16 at 08:57 AM

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

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question