Canvas Plugin Health Bar?

Just started using Construct 2? Post your questions here

Post » Fri Oct 23, 2015 9:04 pm

does anybody know how to draw a resizeable health bar with R0J0hound's canvas plugin?

I know I can make one 100 pixels wide
doing something like this
Draw Box
X 164
Y 94
W (health/maxhealth)*100
H 6

but how do I draw one 328 pixels wide with the health bar being based off of 100%?
B
13
S
6
G
1
Posts: 149
Reputation: 1,960

Post » Fri Oct 23, 2015 11:34 pm

(health/maxhealth)*328 ?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sat Oct 24, 2015 12:15 am

well I have tried (health/100)*healthbar.width when i was using a sprite but that didn't work
maybe because my healthbar.width was changing?
B
13
S
6
G
1
Posts: 149
Reputation: 1,960

Post » Sat Oct 24, 2015 12:27 am

You shouldn't multiply with healthbar.width, but with the maximum width of the healthbar..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775


Return to Beginner's Questions

Who is online

Users browsing this forum: brunopalermo, JackTYGA and 4 guests