[SOLVED]How do I coverup sliderbar?

0 favourites
  • 10 posts
From the Asset Store
Custom Slider Bar Tutorial. I don't have other remaining words to type here
  • 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....

    Thank you.

    P.S. As promised here are the events for making the sprite follow the sliderbar, if anyone is interested.

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

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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:

    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....

  • 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..

  • 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?

    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....

  • > 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?

    > 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..

  • 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.

    CapX: https://dl.dropboxusercontent.com/u/109921357/Slider%20example/Slider_example.capx

  • 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.

  • 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.

  • YEEEEEEEEEEEEEEEEEEEESSSSSSSSSSSSSS!!!!! See guys( LittleStain nimos100 ) that's what I'm talking about!!!!

    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!!!!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)