How do I modify css elements of the progress bar?

Get help using Construct 2

Post » Sun Jul 26, 2015 12:00 am

@Colludium
@Mylon
No problem.. ;)
Last edited by Noncentz705 on Mon Jul 27, 2015 8:37 am, edited 1 time in total.
B
11
S
2
G
1
Posts: 202
Reputation: 1,580

Post » Sun Jul 26, 2015 9:36 pm

Alright, so my "set css value "color" to ""rgb(" & int(255 * (1-(Heroes.HealthCurr/Heroes.HealthMax))) & "," & int(255 * (Heroes.HealthCurr/Heroes.HealthMax)) & ", 0)"" code works in Internet Explorer to change the color of the progress bar based on it's current progress, but this doesn't work in Chrome (because of the use of #HealthBar::-webkit-progress-value makes it more difficult to get in there and dynamically change the style.

Is there away to reference the property or am I going to need to edit the progressbar plugin?

Edit: There doesn't seem to be a way to change the ID of an object. Even if I define 4 possible styles for my progressbar, I have no way of changing the ID to take advantage of those styles.
B
10
S
2
G
2
Posts: 73
Reputation: 1,044

Post » Mon Jul 27, 2015 8:17 am

To apply new styles based on events you might consider using the browser plugin and jquery.
For all the time and css it takes to get a solution working you'll have been better off using sprites and the eventsheet.

To style things consistently across desktop browsers you'll need to make you own progress element.
I've made an example here

Here's the same example in a capx (You'll need to install the plugin before you can run the example)
B
11
S
2
G
1
Posts: 202
Reputation: 1,580

Previous

Return to How do I....?

Who is online

Users browsing this forum: evillair, Yahoo [Bot] and 7 guests