How do I use an .css file in the Slider bar object?

Get help using Construct 2

Post » Sun Jun 26, 2016 7:58 pm

Hey

I'm trying to make my .css file exported into my game work as the css style for my sliderbar object... I added an ID to it but when I preview my game, it doesn't change...

its a simple css file just to test it...
Code: Select all
#slider{
   width:10px;
   height:10px;
   background-color:red;
   cursor:pointer;
}


the ID is slider in the slidebar object
B
32
S
6
G
5
Posts: 437
Reputation: 6,119

Post » Sun Jun 26, 2016 8:24 pm

You have to apply that css file with a plugin at the begin of the app, this for example: plugin-css-import_t78007
B
19
S
6
G
2
Posts: 260
Reputation: 2,653

Post » Sun Jun 26, 2016 8:29 pm

Josek5494 wrote:You have to apply that css file with a plugin at the begin of the app, this for example: plugin-css-import_t78007

thanks for reply, I though this would be supported from native by construct since you have that ID thing in the properties...
B
32
S
6
G
5
Posts: 437
Reputation: 6,119

Post » Sun Jun 26, 2016 8:37 pm

JavaScript HTML DOM - Changing CSS

Code: Select all
"document.getElementById('slider').style.backgroundColor = 'red'"


or use array

arrayCSS.capx
B
67
S
24
G
7
Posts: 1,518
Reputation: 11,072

Post » Sun Jun 26, 2016 9:02 pm

korbaach wrote:JavaScript HTML DOM - Changing CSS

Code: Select all
"document.getElementById('slider').style.backgroundColor = 'red'"


or use array

arrayCSS.capx

the above u mentioned is to change an existing value to another one in the file, it's like a script, not what I'm looking for, as I said what I want is simple, I have a css file and want to apply it to an slider bar
B
32
S
6
G
5
Posts: 437
Reputation: 6,119


Return to How do I....?

Who is online

Users browsing this forum: Exabot [Bot], Google [Bot], Yahoo [Bot] and 30 guests