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"

Labels for items on the ground

Hi all,

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!

Product Version: UE 4.10
more ▼

asked Nov 30 '15 at 02:29 PM in C++ Programming

avatar image

Rebel Camp Games
20 4 7 11

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

1 answer: sort voted first

Hello Stellarbe,

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

more ▼

answered Nov 30 '15 at 05:30 PM

(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