Labels for items on the ground
I'm stuck with creating my item system in c++.
I created an Item class in c++. Now I want to display a label above my items that are on the ground. The label should be the name variable from my item class and should have a black background. Then when I click on the label I should be able to perform my ItemPickup(); function.
What's the best way to achieve this?
Should I be using UMG and blueprints to achieve this or can I do everything in code?
Any example code or blueprints would be greatly appreciated, since there is so few documentation around for UE4 :(
thanks in advance!
asked Nov 30 '15 at 02:29 PM in C++ Programming
Rebel Camp Games
If you only wish for it to be a label and not be interactive in any way, you should be able to do everything you need to do using a TextRenderComponent. You could set it to be offset from the position of the item so that it is above it. You also (if this is your intended functionality) will need to code it so that the text will always face the character.
For more complex options, I'd suggest using UMG and using a hybrid of UMG and C++. If you go down this route, setting up the widget's properties and looks would be most easily done through the editor itself and then you could call said widget with code.
Although this is all in blueprints, this should be able to help: https://wiki.unrealengine.com/Videos/Player?series=PLZlv_N0_O1gZalvQWYs8sc7RP_-8eSr3i&video=r4tltrLLVuQ
answered Nov 30 '15 at 05:30 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here