Don’t know much about writing own tutorials, so I decided to simply share my sources. Haven’t found if anybody already did it, but anyway.
This way you can make button’s shape to be watever you want to.
Here goes a short video, what could be done using this button (in Russian, sorry):Unreal Engine Custom Shape Button (Custom Hit Box) - YouTube
To make it work - just copy 2 sources files (or folder with em) into your project’s source folder.
Check #include “YourProjectName.h” in cpp file and two occurences of YOURPROJECTNAME_API in header file.
Compile and you’ll be able to use new “Common” item in UMG palette - Ovodus Button.
Add any texture with alpha channel into Advenced Hit Texture property, it’s Alpha channel will be used to determine desired button’s shape.
This texture will allways be “stretched” to button’s dimentions, so be careful with paddings and so on.
PS: You can also use same method to make different behaviour depending on the button’s area pressed. Just check for texture’s color, not just alpha, under the mouse cursor. It could be “Pizza Slices, for instance, and so on”.
Please leave your comments and bug reports here or in comments. You can also contact me by email: firstname.lastname@example.org.