[example] How to make a configurable Slider

Get help using Construct 2

Post » Sat May 26, 2012 12:35 am

@Heptagono
Add an instance variable in the slid_line object and assign different value to each of your object.
This way you can pick the one you want.

for instance let say you create the instance variable 'name' for your slid_line.
[code]+slid_line: name = "option2"
-> System: set option2 to slid_line.value[/code]


B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Mon Sep 10, 2012 6:52 pm

Question, how would i attach sound volume to one of these sliders?
B
3
Posts: 4
Reputation: 533

Post » Tue Sep 11, 2012 7:55 pm

as described in the post just before
you create an instance variable named 'name' for slid_line
and you set the value of 'name' for your volume slid_line object to "volume"
[code]+slid_line: name = "volume"
-> Audio: set "your tag" volume to slid_line.value[/code]
Yann2012-09-11 19:56:10
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Sat Oct 13, 2012 2:59 am

Thankyou Thankyou Thankyou !Thankyou!!! Yann you are "THE" LEGEND. saved my poor burned retina's from Hours of Work......You rock...!! I will credit you in my upcoming game...for the Slider code!!!
When in doubt..or you are lost in a Zombie apocalypse or someone is giving you a hard time..Remember one thing..... Read the Construct 2 Manual..it will save your life.:)
B
30
S
11
G
8
Posts: 313
Reputation: 7,360

Post » Sun Mar 03, 2013 3:39 pm

Hello @Yann,
I've tried a lot to modify your capx to support Touch instead of Mouse without success.

There is a way I can use the touch to move the slider instead of click of the mouse?

So I can use it on mobile device.

Can you help me, please?
I'm stuck on this example.
B
10
S
4
G
4
Posts: 42
Reputation: 3,091

Post » Sun Mar 03, 2013 6:14 pm

Last edited by Yann on Sun Sep 14, 2014 11:42 am, edited 1 time in total.
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Sun Mar 03, 2013 8:52 pm

@Yann
Hello,
thanks for your help, but the capx project is not for stable version r119 of C2.

Can you export it for us, poor users of stable version, please?

Thanks,
ghale
B
10
S
4
G
4
Posts: 42
Reputation: 3,091

Post » Fri May 10, 2013 10:57 pm

@Yann I love this example but I have one problem with it. I am using the touch version. My UI layer is scale 0, parallax 0,0. In letterbox scale everything is super. However, I noticed when I run it on a 16:9 tablet and I touch the slider it instantly jumps to the right. So I tried setting my project to scale and bang it does it too. So it appears that if the layout is in scale then the set x calculations are incorrect.

https://www.dropbox.com/s/8ic6cdkc9mudw6n/slider-touch_SCALEPROBLEM.caproj

It is starting to do my head in. Am I missing something obvious? Help!
B
31
S
8
G
5
Posts: 436
Reputation: 5,836

Post » Sat May 11, 2013 1:04 am

Solved the problem.

When setting X change to touch.X("UI")

Easy :)
B
31
S
8
G
5
Posts: 436
Reputation: 5,836

Post » Sat May 11, 2013 7:53 pm

@czar

Yup good catch.
Maybe put a link to your solution, if people have the same issue one day (:
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, Artpunk, Magistross, Yahoo [Bot] and 28 guests