How do I Invert values of a progress bar?

Get help using Construct 2

Post » Fri Feb 10, 2017 9:33 pm

Take a look in this capx:
https://1drv.ms/u/s!Ai2wcz1Xix0ygbw7xNGmm8X0uwb0-w

That's exactly the result I want, but inverted. When the bar is empty, the 'water variable' must be 0, not 100. I tried to just make a different blend mode, to invert the mask effect, but without success :\
B
20
S
4
Posts: 385
Reputation: 2,270

Post » Sat Feb 11, 2017 5:08 am

I didn't see capx but you should try
change fill bar with empty bar
and empty with fill bar
Image
B
64
S
39
G
45
Posts: 651
Reputation: 32,214

Post » Sat Feb 11, 2017 3:50 pm

Unfortunately, you'll have to see the capx to help me :(
The bar isn't just a rectangle, it have rounded corners. so I needed to use 3 sprites: bar fill, bar border and bar mask.
B
20
S
4
Posts: 385
Reputation: 2,270

Post » Sat Feb 11, 2017 7:20 pm

@Zathan

you probably want to change the set BarMask width event to say: lerp(Self.Width,(100-Water)*150/100,3*dt)

that reverses it...
B
95
S
33
G
20
Posts: 438
Reputation: 17,640

Post » Sat Feb 11, 2017 8:49 pm

AllanR wrote:@Zathan

you probably want to change the set BarMask width event to say: lerp(Self.Width,(100-Water)*150/100,3*dt)

that reverses it...

That's it!
Thank you very much.
B
20
S
4
Posts: 385
Reputation: 2,270


Return to How do I....?

Who is online

Users browsing this forum: lukewasthefish and 16 guests

cron