How to change UMG button image when button Has Keyboard Focus?

Kind of an old topic, but here’s a way to fix this. Keep in mind this is for buttons that have an image component. I found a to work around this quirk by converting the images I used for the buttons into sprites, putting the buttons themselves into an array, and the sprites into an array accordingly (Seperate array for unhovered and hovered sprites.) Then a branch with “has keyboard focus” condition. If false it converts the normal button sprites into brushes from the array and sets the style. If true, it sets the index variable (promote to var) and sets that buttons style through sprite >> brush. Hope this helps anybosy trying to search how to do this.

Edit: If you do this, the hovered image component will be replaced on mousehover, so hovering with mouse wont change the sprite. To fix this is easy: add a button “On hovered” event to each button, get a ref to that button and plug both the event and the button ref into a “set Keyboard Focus” node. Happy blueprinting!

1 Like