Download

UMG Widget: Question about showing how much a progress bar will be depleted

I have a progress bar that moves from left to right, I want to be able to take the current placement of the progress bar’s value in screen space and overlay another that moves from right to left, at that location. As a way to sort of show the player how much of the original progress bar will be depleted

I made a quick mockup in photoshop of what I’m trying to convey.

1b05ba56f7de9e6a105db13496989e27b578acce.png](filedata/fetch?id=1773724&d=1591734516)

4355fb69837d6e732fc62c12ddff55fc0f32eded.png](filedata/fetch?id=1773726&d=1591734680)

bare in mind that the original bar as shown is meant to represent the bar at less than 100%; meaning that I want the overlayed bar to be able to determine the current position of the original bar and place itself there, instead of simply placing another bar at the 100% point and moving from right to left from there, which wouldn’t work with any other value other than 100%

If you know any better manner to go about my intentions, please don’t be afraid to tell me what it is.

Thanks in advance.

https://forums.unrealengine.com/core/image/gif;base64
​​

I don’t quite get it, because a default progress bar already shows it’s full size and how much has been depleted:

82dc08fc50e8d28f8265161ec55c9d894ccc2034.jpeg

But why not just put another bar in the same place on the widget and make it run from right to left, with a value of 1-x where x is the value of the first bar:

b021c8e645750efc72d09fe1e6d8fa8062555606.jpeg

I figured it out,

I put a size box below the progress bar and did some math in the widget graph to have the image in the box move with the progress bar and add +1 to brush size on the x-axis in real time when a button is pressed. Once that button is released it takes the %of the size box and subtracts that from the progress bar. The end result is:

Btw, this was my intent, just wanted to share.

I re-read my last post and realised I didn’t quite properly convey what i meant. Thanks nonetheless.

Ah, ok. No I didn’t quite get that… :slight_smile: