you need to make your own C++ class based on UUserWidget, lets call it MyUUserWidget. Then create a Widget Blueprint, open it, switch to Graph Editing Mode and open the Blueprint Props. In the Details section > Globals > Parent Class you have to choose your newly created MyUUserWidget class.
Add any functions or variables in your MyUUserWidget.h file like so:
public:
// expose this function so that it can be called via a node from BP
UFUNCTION(BlueprintCallable, Category = MyUUserWidgetClass)
void handleMyButtonClick();
In your MyUUserWidget.cpp:
void MyUUserWidget::handleMyButtonClick()
{
// implementation of functionality
}
In your Blueprint, you can now right-click in the Graph Editing Mode and choose your function.
Well, to view the source code of BP events you can always search the docs or in the source code as well.
Thanks for your help. I am trying to achieve video playback in UE4.6. Upon some research, I got to know that Media Textures can be used for the same. However, I could not find out how to do this using C++ code. My plan is to write a function which does the following steps:
Create the media texture out of a .wmv file.
Add the media texture to a wall/cube.
Start the playback so that the video can be seen on the wall/box.
Please clarify if something is wrong in my thought process. Can you provide some sample code / commands which can be used to achieve this?