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"

How to change the opacity of any button in a Widget, when hovering it ?

Hello,

I'd like to ask : Does anyone have any solution to make any hovered button's opacity 1 and all others 0,7, in a Widget ?

Here's the way I do it :

alt text

Then, when I don't hover it anymore, opacity goes back to 0,7.

alt text

Remark : The button's background color is completely transparent, so I can change the button's Color and Opacity's Alpha, it'd do the same

Well, that's for the basic buttons of the menu, but then, the Continue the Options buttons call a WidgetSwitcher and we have to do the same opacity handling stuff with many more buttons. In the end, the graph would be so long for a simple and repetitive task I can't believe there is no better way to do it.

I could think of a few different solutions :

  • Widget's Tick calling a ForEach (Button b in self) -> change b's opacity if Hovered.

  • Get Hovered element(s) in Widget, then cast the element(s) to button and change Opacity if cast done successful.

    For these two solutions, keep in mind that we have to reset the button's opacity to 0,7 when Unhovered (with tick affecting 0,7 if not hovered or with temporary reference maybe).

  • Overriding/Redefining the On Hovered (and then On Unhovered the same way) event in Type Button (or only this Widget's buttons if it's possible) to change the button's opacity On Hovered's calling.

Thanks a lot !

PS : If it could help, here's a part of the concerned elements my Widget Hierarchy (then there are also buttons in Resolution and in Keyboard)

alt text

Product Version: UE 4.21
Tags:
issue1.jpg (65.6 kB)
issue2.jpg (64.9 kB)
issue3.jpg (23.6 kB)
more ▼

asked Nov 11 '18 at 08:41 PM in Blueprint Scripting

avatar image

k_Rave
1 1

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

1 answer: sort voted first

The easiest way is to Get all the Buttons > MakeArray > ForEachLoop > GetIsHovered > create a Branch > out of True Set Opacity to 1 > out of False Set Opacity to 0.7. Connect the execution to a Tick.

more ▼

answered Nov 13 '18 at 04:04 PM

avatar image

Ego Studio
606 4 4 5

(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