x

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"

UMG Usage - Making A Special Health Bar

I'm actually trying to do a health bar, a bit like the one you can find in League of Legend for instance.

The health bar should have multiple section in it. Let's say that the player have 450 HP and i want a split every 50HP.

That means that my health bar should be slice in 9 for this example.

The thing is that I'm pretty sure that I need to create a base texture with at least a split in it and then try to tile that base on the maximum HP, but in fact I really can't manage to find a way to do so in the UMG.

I'm pretty it's fairly easy too and I will probably sound dumb but anyway if any of you have anything to say or to link that can help me get over this thing I'll be very gratefull.

Product Version: UE 4.19
Tags:
more ▼

asked May 06 '18 at 02:50 PM in Using UE4

avatar image

Yawaka
3 1 2 6

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

1 answer: sort voted first
more ▼

answered May 06 '18 at 05:37 PM

avatar image

Everynone
13.8k 74 25 57

avatar image Yawaka May 06 '18 at 06:27 PM

this is nice, but it's not what I really want to do, I don't think.

It's more like in this video what i want to achieve https://www.youtube.com/watch?v=sJGWNBr-zXk

avatar image Everynone May 06 '18 at 06:37 PM

This is actually much easier, looks like a standard progress bar with a textured background. If the background needs to be dynamic, you could use a material for that. There should be plenty of tutorials on YT for standard progress bars.

Unless I'm missing something special about it. Do tell if there's an element you're not sure about.

avatar image Yawaka May 06 '18 at 06:58 PM

Well, I think you are right.

It needs to be dynamic just didn't know a thing about material for UMG will dig a bit in that way thanks :)

avatar image Everynone May 06 '18 at 07:26 PM

You could also just glue the background together, like demonstrated in the linked thread. Just use images without edge gaps. Material approach should be fine, too. Good luck.

avatar image Yawaka May 06 '18 at 07:36 PM

wouldn't it be a bit less efficient than a material ? because the maximum HP may change a lot

avatar image Yawaka May 06 '18 at 07:53 PM

Well, look like I got it working if only I knew that material can be used on UMG before ^^'

Thanks a lot

avatar image Everynone May 06 '18 at 08:17 PM

Well, that was fast!

When it comes to performance, I am unable to answer the question. Too many factors. Perhaps one of the Epic's top brass could from the top of their head. You could always use both methods and post the results.

However, if I may suggest something - consider focusing on something that's the easiest to implement and, most importantly, maintain. Blueprints are somewhat slow when compared to native code anyway. If you want superb performance, you go C++. Besides, the cost of running a widget is pretty much negligible unless it's a mobile app. Not advocating bad practises, though.

Good luck!

avatar image Yawaka May 06 '18 at 08:30 PM

Yes, i'm trying to do as much as I can in c++ such as all the code that will rule the WidgetBP, I pretty mutch just use a WidgetBP to place the element on the UI and then bind them in my c++ base class for this widget.

(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