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"

UMG Non-Rectangular Buttons

I am trying to create a radial menu with buttons. I can get the menu to work, but the outline of the actual buttons are still rectangular, so the buttons overlap each other. In the screen shot, the button is activated when clicked anywhere in the green box, not the blue button. Is there any solution to this? Or are rectangular buttons still the only solution?

alt text

Product Version: UE 4.14
screen capture.png (31.5 kB)
more ▼

asked Dec 19 '16 at 08:54 PM in Blueprint Scripting

avatar image

68 15 27 37

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

1 answer: sort voted first

This is what you are looking for. The feature in UMG is called Advanced Hit Test and allows you to use any shape you want using a mask.


more ▼

answered Dec 20 '16 at 04:26 AM

avatar image

2.6k 63 28 281

avatar image DMHokie Dec 20 '16 at 01:28 PM

Awesome. That is it. I can't seem to get the button to show up in the widget editor. I followed his steps and added my project name, but I may not have them copied into the right folder. What exact folder are the 2 files supposed to be copied into?

avatar image Dartanlla Dec 20 '16 at 09:04 PM

Ah, sorry about that. Forgot to mention that you have to have Visual Studio installed and be compiling your C++ project. I always assume everyone uses UE4 this way. If you have that setup, then do the following (I just followed these steps and confirmed it works in 4.13):

Copy the files to the Source/[YourProjectName] folder

Add them to your C++ project

In your [YourProjectName].Build.cs file:

Add UMG so the line looks like this:

PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "UMG" });

Then in the same file, un-rem out PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });

Replace both occurrences of TESTPROJECT_API in the OvodusButton.h file with [YOURPOJECTNAME]_API

In OvodusButton.cpp add:

include "[YOURPOJECTNAME].h"

bove the line: #include "OvodusButton.h"

Add the following two lines to [YOURPROJECTNAME] .h under the #includ "Engine.h" line:

include "Runtime/UMG/Public/UMG.h"

include "Runtime/UMG/Public/UMGStyle.h"

Compile your project and run it. In the UMG editor you will now see the OvodusButton show up in the palette.

avatar image DMHokie Dec 21 '16 at 01:39 PM

Oh ok. So this only works if you are using C++? I have never set up my project that way, so I guess that's why it isn't working...

avatar image Dartanlla Dec 21 '16 at 01:53 PM

Yep, this requires C++, because it is custom functionality that is not included in UE4. Even if you have no plans to program in C++, I recommend setting up the environment so you have more options. One of the greatest things about UE4 is the way you can mix blueprints and C++ in the same project. I always create my projects as blueprint projects, but then use C++ to fill in the missing functionality that is not included in UE4. All you have to install is this: https://www.visualstudio.com/vs/community/

avatar image DMHokie Dec 21 '16 at 02:05 PM

I see. I have always just been scared of C++, but you've convinced me. When I set up my projects now, should I use the C++ templates, then just use Blueprints as normal, until I need to include some kind of C++ feature? Or is there a better way to set up my projects to use both Blueprints and C++?

avatar image Dartanlla Dec 21 '16 at 02:15 PM

There are many ways to do it, but here is what I do. I always start with a blueprint project. Then when I need to add C++ functionality, I choose "New C++ Class" from the File menu in UE4. Then it asks you to pick a Parent Class. Character and Actor are the most common ones I use. Give it a name and then click Create Class. The first time you do this in a blueprint project, UE4 will automatically setup your C++ project for you (if you have Visual Studio 2015 Community Edition installed). Once you do this to your existing project, you can follow my steps above for adding that new UMG button.

The best way to think about it is that UE4 is a collection of tools that Epic has built. Blueprints only allow you to use tools that are already built. C++ allows you to build new tools and then use them in your blueprints.

avatar image DMHokie Dec 21 '16 at 04:07 PM

Dude, you're my hero. I got it working now. The only thing I had to change was in the OvodusButton.h, instead of replacing the TESTPROJECT_API, I just deleted it. When I replaced them, I was getting all kinds of errors. Just deleting gave me no errors and it all works. Not sure why though. Thanks for all the help!

avatar image Dartanlla Dec 21 '16 at 05:01 PM

Ok, great! Glad you got it working. Be sure to mark the answer by clicking on the checkmark next to the first answer so other people with the same question as you can find it. Thanks!

(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