How do I make two point range slider-bar?

0 favourites
  • 4 posts
From the Asset Store
Connect the dots in the correct order and draw happy animals!
  • Something like this.

    The first point control the First Global Variable (Which would control the MIN range) and Second Point would control the second Global variable (Which would control the MAX range).

    Please help.

    Tagged:

  • Unfortunately, for this I believe you'll have to implement a custom slider bar. Here is an example I threw together for you. You will have to figure out your value calculations but it should do just about everything else you need it to.

    drive.google.com/file/d/1vroBAYGSuyIpygUt8K1CsExNcAedT7_5/view

  • Unfortunately, for this I believe you'll have to implement a custom slider bar. Here is an example I threw together for you. You will have to figure out your value calculations but it should do just about everything else you need it to.

    https://drive.google.com/file/d/1vroBAYGSuyIpygUt8K1CsExNcAedT7_5/view?usp=sharing

    Thanks InDWrekt This is exactly what I wanted.

    Need little help with the calculations part. Suppose I want the range 0 to 100 then what we have to do is calculate the width of "BarBackground" then put it to our code in order to match with our desired range.

    (Correct? Actually, I tried it but couldn't able to crack it yet, values are coming in negatives 😅)

    Can we create two Global variables "gv_MIN_Range" & "gv_MAX_Range" integrate them into the code? So that we won't have to calculate it every time if we alter the width of BarBackground or we need a different range.

    Another thing is the gap b/w the two sliders, please check the below image

    Can we reduce the gap up to 1 value apart?

    I have modified your c3p Lil bit and attached the c3p here, please check.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You will have to figure out your value calculations...

    As stated in my original post, you will have to "figure out your calculations".

    In my example, I did this to define the value of the sliders:

    int(Self.X - (BarBackground.X - (BarBackground.Width / 2)) - (SliderEndLeft.Width / 2))

    You really don't need this, all you need to know is the current distance your 2 sliders can be away from each other and divide it from the maximum distance they can be. This will give the percent distance which can be used to calculate your values.

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