So i just started with UMG and after a week of messing around with it.
I wanted to extend the Widget Blueprint, i got some great help from Nick Darnell so thanks again.
UPDATED VERSION CAN BE FOUND HERE
In order to derive my class from UUserWidget:: i did the following.
* 1 Header Files:
Added several headers to my project header. "(YourProjectName.h)".
* 2 Adding Modules:
And then i also made sure that the UMG and Slate Modules was included as well.
In "(YourProjectName.Build.cs)":
* 3 Compile
Compile and re-open the editor.
And add a new class to the project derived from UUserWidget::
If you where wondering how the header of the derived class looks like after created/ added from the editor.
* 4 Using the new User Widget class.
Create a new Widget Blueprint

* 5 Set the Widget Parent
Open up the new Widget you just created and go to the Graph of the Widget Blueprint.
Press on the
button on the top of the window.
* 6 Go down to the details.
Under the Category "Globals" you set the class you derived from UUserWidget.

You are done, now you have a simple and fast way to extend the user widget.
From everything from Data Storage to picking up "events" delegates and so on.
Hope this was helpfull.
WCode
Wiki Entry: https://wiki.unrealengine.com/UMG,_H...MG_in_C%2B%2B.
New Wiki Entry: Extend UserWidget for UMG Widgets
I wanted to extend the Widget Blueprint, i got some great help from Nick Darnell so thanks again.
Disclaimer
This was done in UE 4.4.2 as UMG is experimental and may change this solution may change/ "break" in future versions.
This was done in UE 4.4.2 as UMG is experimental and may change this solution may change/ "break" in future versions.
UPDATED VERSION CAN BE FOUND HERE
In order to derive my class from UUserWidget:: i did the following.
* 1 Header Files:
Added several headers to my project header. "(YourProjectName.h)".
Code:
#include "Runtime/UMG/Public/UMG.h" #include "Runtime/UMG/Public/UMGStyle.h" #include "Runtime/UMG/Public/Slate/SObjectWidget.h" #include "Runtime/UMG/Public/IUMGModule.h" #include "Runtime/UMG/Public/Blueprint/UserWidget.h"
And then i also made sure that the UMG and Slate Modules was included as well.
In "(YourProjectName.Build.cs)":
Code:
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "UMG", "Slate", "SlateCore"});
Compile and re-open the editor.
And add a new class to the project derived from UUserWidget::
If you where wondering how the header of the derived class looks like after created/ added from the editor.
Code:
#pragma once #include "Blueprint/UserWidget.h" #include "InventoryWidget.generated.h" /** * */ UCLASS() class MYGAME_API UInventoryWidget : public UUserWidget { GENERATED_UCLASS_BODY() };
Create a new Widget Blueprint

* 5 Set the Widget Parent
Open up the new Widget you just created and go to the Graph of the Widget Blueprint.
Press on the

* 6 Go down to the details.
Under the Category "Globals" you set the class you derived from UUserWidget.

You are done, now you have a simple and fast way to extend the user widget.
From everything from Data Storage to picking up "events" delegates and so on.
Hope this was helpfull.
WCode
Wiki Entry: https://wiki.unrealengine.com/UMG,_H...MG_in_C%2B%2B.
New Wiki Entry: Extend UserWidget for UMG Widgets
Comment