How to use the "Set Css Style" on Progress Bar?

Get help using Construct 2

Post » Fri Nov 21, 2014 9:22 pm

I have just put together a simple tutorial here that shows you a way of inputting css values as a single data string - no plugins required. Hope this helps...
A big fan of JavaScript.
B
74
S
20
G
69
Posts: 2,205
Reputation: 43,832

Post » Sun Nov 23, 2014 6:40 pm

Image
B
11
S
2
G
1
Posts: 202
Reputation: 1,580

Post » Wed Dec 31, 2014 8:08 am

Ashley wrote:You can set any CSS value the browser understands. We can't possibly document all of CSS - there are existing websites covering how CSS works which you can use as a reference.


@Ashley

Actually i know CSS, this is what I was asking for: the method of putting into that field.... There was no example or documentation of how to enter these values in. It seems i was on the right track, but didnt try it with quotes. Would be worth putting this screenshot in the manual maybe..?

Image

Thank you for the tutorial / example @Colludium
Made Cosmochoria - www.cosmochoria.com
Currently working on Slayaway Camp - www.slayawaycamp.com
B
27
S
8
G
3
Posts: 384
Reputation: 5,020

Post » Wed Dec 31, 2014 8:18 am

Well it seems i still don't get it?

This is what im using in the fields... is this incorrect? I thought this matches the tutorial posted...

Image

Any help / guidance greatly appreciated @Ashley
Made Cosmochoria - www.cosmochoria.com
Currently working on Slayaway Camp - www.slayawaycamp.com
B
27
S
8
G
3
Posts: 384
Reputation: 5,020

Post » Wed Dec 31, 2014 12:07 pm

@80bit Shouldn't the property name be "background" instead of "monster_bar" and the value "#ff3019"?

That tutorial you were looking at is basically just showing how to parse a blob of CSS into individual CSS "property name + value" events.
B
21
S
5
Posts: 196
Reputation: 1,974

Post » Wed Dec 31, 2014 5:40 pm

I think @ggibson1 is correct - the property name should be the text before the colon from the css sheet, all in "". The value is the data to be inserted into the parameter and it comprises everything after the colon up to, but not including, the semi colon. Although I wrote the tutorial I'm no css expert - I'm just becoming less inefficient at using c2 LOL.
A big fan of JavaScript.
B
74
S
20
G
69
Posts: 2,205
Reputation: 43,832

Post » Wed Dec 31, 2014 6:28 pm

OK, so i think the issue is that the 'background' property does not work. I can add a "border" as a property name and "4px solid #F00" to add a red border to the progress box, but adding "background" as a property and a color always changes the color to a dark/greyish green, not the colour i specify.

Is it possible to get a list of what the elements are classified as / what property names to use?

Ie. How do i change the background of the progress bar? How do i change the bar itself?
Made Cosmochoria - www.cosmochoria.com
Currently working on Slayaway Camp - www.slayawaycamp.com
B
27
S
8
G
3
Posts: 384
Reputation: 5,020

Post » Sat Jan 03, 2015 2:00 pm

If you want to customise the appearance to something significantly different to the default, you will probably find it easier just to compose a new progress bar out of sprites and tiled backgrounds.
Scirra Founder
B
395
S
231
G
88
Posts: 24,367
Reputation: 193,694

Post » Thu Jan 08, 2015 6:16 pm

Understood, i guess the issue is there is still zero documentation regarding what elements can actually be styled. So there's an option to add css styles to the progress bar, but no clear definition on what elements we are able to style and how.

Im guessing based on the lack of answers that it's not actually possible to change the background colour of a progress bar using the built in css expression?
Made Cosmochoria - www.cosmochoria.com
Currently working on Slayaway Camp - www.slayawaycamp.com
B
27
S
8
G
3
Posts: 384
Reputation: 5,020

Post » Thu Jan 08, 2015 6:16 pm

@ashley
Made Cosmochoria - www.cosmochoria.com
Currently working on Slayaway Camp - www.slayawaycamp.com
B
27
S
8
G
3
Posts: 384
Reputation: 5,020

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: tarek2 and 16 guests