[SOLVED]How do I coverup sliderbar?

Get help using Construct 2

Post » Fri Jul 17, 2015 11:32 am

Hello World,

So I want to make 2 sliders for the music&sounds volume in my game. As such I have 2 options(I think only these 2) to use the sliderbar plugin or to make a sliderbar myself, manually with events.
The first option is obviously the easiest, and the one I'd rather go with, but we all know the problem with that one, the sliderbar looks like absolute ***.... So I figured I'd just cover it up with some sprites.

I already got the events to make the sprites mimic the sliderbar movement(I'll show them at the end of the post in case anyone is curious), but the problem is the stupid sliderbar always stays on top, as you can see in the picture below.
I tried puttin my sprites on a higher layer, I tried giving that layer force own texture and using blend mode on the sprites, I tried setting the sliderbar itself to invisible(which stupidly enough makes it stop working altogheter...) nothing helped.

So pleeeeaaaasseeee, is there any way to cover up that ugly looking thing with my sprites?!?!?! I really don't want to have to make my own sliderbar from events, I found an example capx but it looks quite complicated....:(
Image

Thank you.

P.S. As promised here are the events for making the sprite follow the sliderbar, if anyone is interested.
Image
Last edited by VIKINGS on Fri Jul 17, 2015 4:46 pm, edited 1 time in total.
B
21
S
11
G
6
Posts: 414
Reputation: 5,335

Post » Fri Jul 17, 2015 11:52 am

You could choose to use a programmed sliderbar instead of the slider-bar plugin..

example-how-to-make-a-configurable-slider_t67233?&hilit=slider
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Fri Jul 17, 2015 12:15 pm

I already had that capx downloded @LittleStain , and I already had 2 problems with it:
a) It uses an every tick event, and I would like to keep the use of every tick to an absolute minimum.
b) It has a blank even, probably a mistake or oversight from it's creator, so I wouldn't know what to put in that event if I tried to replicate it.
Here's what I mean by blank event:
Image

And while it is less complicated then the other example capx that I was referring to, it's still way more complex then using the sliderbar(if I could hide it) and then just basically having 1 event on sliderbar changed action set volume to sliderbar value....
B
21
S
11
G
6
Posts: 414
Reputation: 5,335

Post » Fri Jul 17, 2015 12:35 pm

a blank event is the same as "system every tick" event
It has no conditions so it is performed every tick..

Replacing the every tick events in this capx is hardly an effort..
Also adding an event to check if the new value is different from the one before would be the same as using "on changed"

The big advantage of doing it this way is that no Dom elemnts are used, Dom elements float above the canvas.
I'n not sure how easy it is to use css to change the appearance of the slider-bar object and how much freedom C2 allows in this case..

If you were to set the slider-bar invisible and use sprites to influence it, it would be much the same as the link I gave except for the extra slider-bar object..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Fri Jul 17, 2015 12:45 pm

LittleStain wrote:Replacing the every tick events in this capx is hardly an effort..


And how would you modify that capx to not use every tick for example?

LittleStain wrote:If you were to set the slider-bar invisible and use sprites to influence it, it would be much the same as the link I gave except for the extra slider-bar object..


Yeah, expect for the fact that the stupid sliderbar stops working if you set it to invisible.... I'm not sure if that's a bug, or if it's supposed to be that way, but it just doesn't work while invisible....:(
B
21
S
11
G
6
Posts: 414
Reputation: 5,335

Post » Fri Jul 17, 2015 1:43 pm

VIKINGS wrote:
LittleStain wrote:Replacing the every tick events in this capx is hardly an effort..


And how would you modify that capx to not use every tick for example?

LittleStain wrote:If you were to set the slider-bar invisible and use sprites to influence it, it would be much the same as the link I gave except for the extra slider-bar object..


Yeah, expect for the fact that the stupid sliderbar stops working if you set it to invisible.... I'm not sure if that's a bug, or if it's supposed to be that way, but it just doesn't work while invisible....:(


By replacing conditions and/or adding more..

instead of every tick you could use is touching or is mouse button down which would limit the updates to the time change is possible..
you could use on mouse button released or on any touch end to change the animations..
you could add an extra variable OldValue and have actions triggered only when value is different from value..
It would all depend on your needs, but the trick is adding extra conditions or changing the ones already there..

I'm working with this example myself, changing the object on which it has influence with the scroll-button of the mouse, updating the shown value depending on the attached variables to the object. I also try to limit every tick events and the above methods are some of the ones I've used..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Fri Jul 17, 2015 1:59 pm

VIKINGS wrote:The first option is obviously the easiest, and the one I'd rather go with, but we all know the problem with that one, the sliderbar looks like absolute ***.... So I figured I'd just cover it up with some sprites.

You can't hide form controls as they are rendered on top of everything.

Anyway here is an example of how to do it without using "every tick" and by using the dragdrop behaviour.

Image
Image

CapX: https://dl.dropboxusercontent.com/u/109921357/Slider%20example/Slider_example.capx
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,838

Post » Fri Jul 17, 2015 2:16 pm

Sigh... Well then I guess I have to eighter wait for @Ashley to fix the invisible bug(I've submited a bug report) or use one of those methods and make it myself.
I was sooo hoping there was a quick, easy and simple method of hiding the sliderbar, I had no idea it was a Dom element or that those elements where drawn above the canvas.... :(
Anyway, thank you guys.
B
21
S
11
G
6
Posts: 414
Reputation: 5,335

Post » Fri Jul 17, 2015 4:24 pm

You could try using the CSS "opacity" property of the slider bar so it becomes fully transparent (Set CSS style "opacity" to "0"). Transparent DOM control still function as normal, so this should work as you first intended.
Last edited by Magistross on Fri Jul 17, 2015 4:52 pm, edited 1 time in total.
B
69
S
28
G
24
Posts: 977
Reputation: 18,739

Post » Fri Jul 17, 2015 4:42 pm

YEEEEEEEEEEEEEEEEEEEESSSSSSSSSSSSSS!!!!! See guys( @LittleStain @nimos100 ) that's what I'm talking about!!!! :D
It worked, it's simple, it's easy and now I can get on with my life!
Thank you so so very very much @Magistross , awesome idea!!!! :mrgreen:
B
21
S
11
G
6
Posts: 414
Reputation: 5,335


Return to How do I....?

Who is online

Users browsing this forum: plinkie and 16 guests