I want to use a widget made in blueprint in another widget made in C++.
Basically because the one that is made in blueprint is just an interface/template but with style.
So this is my widget made in blueprint.
This is my code in C++
And i want to use UI_TextBlock instead of UTextBlock
But I can’t include the class like I normally would in C++
Is it possible to do it? How to do it?
Thank you so much!!
UPDATE:
I tried the solutions offered to me in the answers. However I have not been able to get it to work. I think it’s my fault. I should have given more information about my custom TextBlock class. I think that is why it is more complex than I imagined.
This is the class:
I made a blueprint derived from this class and it worked fine.
I want to be able to make multiple instances of this class in the same way as bluprints but using C++.
I think that when instantiating the object the “constructor” is not executed.
I tried to instantiate all the objects of the class by in a function outside the constructor. but this didn’t work either.
I’m just trying to do the same thing I’ve done before with bluprints but in C++. Use a simple UserWidget as a component so that I can reuse it in another more complex UserWidget (Simple Composition).
I’ve put the classes and the implementation in these two header files if you want to take a look. Maybe so you can see what I’m doing wrong.
CTextBlock.h (6.8 KB)
LobbyWidget.h (2.4 KB)
Thank you very much for your help.