[SOLVED] Styling sliders with CSS

Get help using Construct 2

Post » Tue Sep 05, 2017 9:34 am

Hey all! I'm working on an editor for game content, and have managed to make a nice-looking UI using the in-built form elements, styled with CSS - but I can't get sliders to style at all! They respond to css in weird ways, for example, changing the border-radius seems to simply extend and slightly the rail of the slider.

Anyone had any success styling their sliders with CSS?
Last edited by mrtumbles on Tue Sep 12, 2017 7:12 pm, edited 1 time in total.
The LEVEL GENERATOR TOOLKIT



24 functions dedicated to producing randomly generated terrain for all kinds of games.
B
25
S
7
Posts: 247
Reputation: 2,318


Post » Tue Sep 05, 2017 9:55 am

The first relies heavily on extensive use of plugins (which is incompatible with the goals of this project), the second doesn't work for slider-bars :( Thanks though! I've managed to get the rail to style using "webkit-appearance: none" but that's all so far.
The LEVEL GENERATOR TOOLKIT



24 functions dedicated to producing randomly generated terrain for all kinds of games.
B
25
S
7
Posts: 247
Reputation: 2,318

Post » Tue Sep 05, 2017 12:38 pm

mrtumbles wrote:The first relies heavily on extensive use of plugins (which is incompatible with the goals of this project), the second doesn't work for slider-bars :( Thanks though! I've managed to get the rail to style using "webkit-appearance: none" but that's all so far.


ah that is because sliders dont take CSS if i remember correctly, someone said something about that in a very old post! i think was ashley. i would do a custom slider bar though.

just use the loading % rule usage.

sorry for giving you those dead end links ... forgot sliders arent working 100% (css wise atleast)
B
78
S
23
G
69
Posts: 1,354
Reputation: 44,027

Post » Tue Sep 05, 2017 5:06 pm

mrtumbles wrote:The first relies heavily on extensive use of plugins...


There is actually only one incomplex plugin - CSS Import ..
when you open runtime.js you will see Import CSS function & Remove CSS function
to avoid using the plugin. you can write this function in Browser: Execute Javascript
not best way..but anyway... just for fun..

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

Post » Tue Sep 05, 2017 5:35 pm

korbaach wrote:you can write this function in Browser: Execute Javascript
not best way..but anyway... just for fun..

Browser_Import_CSS.capx


Just what I was looking for! I'll get down to it now...
The LEVEL GENERATOR TOOLKIT



24 functions dedicated to producing randomly generated terrain for all kinds of games.
B
25
S
7
Posts: 247
Reputation: 2,318

Post » Tue Sep 12, 2017 7:11 pm

Just to holler back; the above example from @korbaach is exactly what was necessary to allow me to style my sliders (and anything else in the page that was being a bit awkward) without using plugins. Several testing phases (so a good few hundred runs) in and it still hasn't once failed to correctly style my widgets. Very happy.

Many moons of happiness upon @korbaach
The LEVEL GENERATOR TOOLKIT



24 functions dedicated to producing randomly generated terrain for all kinds of games.
B
25
S
7
Posts: 247
Reputation: 2,318


Return to How do I....?

Who is online

Users browsing this forum: dop2000, plinkie, Seruza, Yahoo [Bot] and 8 guests