How do I customize slider plugin with 9patch images

Get help using Construct 2

Post » Thu Jan 18, 2018 2:11 pm

I saw some CSS custom slider .capx on the forums but when i try to download they expired, page not found,etc... :S

Is possible to change the two parts of a slider by 9patch images? Due i want to resize the window and other stuff and need the sliders still look ok without stretch.

Is possible?
B
30
S
12
G
3
Posts: 685
Reputation: 5,112

Post » Thu Jan 18, 2018 9:44 pm

You can make your own slider with 2 sprites (or 9patches), it's easy. Here is an example from another post:
how-do-i-successfully-make-a-span-class-posthilit-slider-span-fx-bo_p1153790?#p1153790
Image

Did I help to fix a problem in your game? You can buy me a cup of coffee :) If you'd like to hire me, please see this post
B
19
S
9
G
158
Posts: 2,394
Reputation: 84,415

Post » Thu Jan 18, 2018 10:30 pm

If there is no other way i guess i will have to use this method, but if is possible i prefer use the original one just changing the gfx. The original one also have step value, maximun and minimun. Also other actions/expresions that are helpful.

So the idea is have just a css3 import to change just that gfx and keep all the options.
B
30
S
12
G
3
Posts: 685
Reputation: 5,112

Post » Fri Jan 19, 2018 9:10 am

matriax wrote:If there is no other way i guess i will have to use this method, but if is possible i prefer use the original one just changing the gfx. The original one also have step value, maximun and minimun. Also other actions/expresions that are helpful.

So the idea is have just a css3 import to change just that gfx and keep all the options.


Using search I found the following: https://www.scirra.com/forum/styling-sliders-with-css_p1139448?#p1139448 from korbaach. Link is valid and as far as I can tell, it does what you want.

Worth a try at least.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
147
S
34
G
89
Posts: 5,993
Reputation: 62,851

Post » Fri Jan 19, 2018 10:21 am

@zenox98 Yes, i actually can do that, they just change the appearance of the sliders using CSS code, but how change that parts by sprites you have in the layout or 9patch objects? Is the thing i can't achieve :S
B
30
S
12
G
3
Posts: 685
Reputation: 5,112

Post » Fri Jan 19, 2018 1:56 pm

@matriax
Minimum, maximum and step are easily done with instance variables and a couple of events.

SliderBar is a Form Control object, and form control objects in C2 have lots of issues - they are rendered above all layers, have problems with scaling, scrolling, parallax etc. I really don't like using them in games.
B
19
S
9
G
158
Posts: 2,394
Reputation: 84,415

Post » Fri Jan 19, 2018 2:16 pm

Well, i'm doing a tool similar to the PixaTool that i finished, and for this new one i want to give a better UI.

Also due the sprites/9patch are in layout, they will still appears above all ?. Maybe if they can be done via CSS maybe there is some trick to make them invisible but functional and set my GFX there. But well, still looking for that.

Or maybe a slideBar plugin but based on actions like the events but already done with steps, minimun and all with an action in events to set what objects to be used as gfx. Wonder if rexrainbow or r0j0 have some mod or their own version with that, time to search.
B
30
S
12
G
3
Posts: 685
Reputation: 5,112


Return to How do I....?

Who is online

Users browsing this forum: kamaleon70 and 4 guests