Slider

Talk about making games.

Slider

Postby Joshua Worth » Tue Aug 16, 2005 10:19 am

I am trying to make a click and drag slider exept I'm failing with the code :roll:
I can't add a picture, but something like this:

+ ===|====== -
Stay sweet
User avatar
Joshua Worth
 
Posts: 515
Joined: Tue Jul 19, 2005 12:00 am
Location: Stralia
Score: 5 Give a positive score

Postby jazz_e_bob » Tue Aug 16, 2005 12:21 pm

Interesting...

I'll see if I can come up with something.
Controlling complexity is the essence of computer programming.
User avatar
jazz_e_bob
 
Posts: 742
Joined: Tue Jul 01, 2003 9:38 pm
Location: Bloke from Cockatoo Creek Australia
Score: 14 Give a positive score

Postby Game A Gogo » Tue Aug 16, 2005 1:21 pm

I know how to create one whitout click'n'drag, but whit button
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Postby ondy1985 » Tue Aug 16, 2005 2:47 pm

After seconds and seconds of thinking I came up with a quick easy-to-use solution. You can download the source .ged here.

Hope it helps.
User avatar
ondy1985
 
Posts: 99
Joined: Thu May 05, 2005 7:43 pm
Location: Slovakia
Score: 1 Give a positive score

Postby jazz_e_bob » Tue Aug 16, 2005 11:07 pm

Controlling complexity is the essence of computer programming.
User avatar
jazz_e_bob
 
Posts: 742
Joined: Tue Jul 01, 2003 9:38 pm
Location: Bloke from Cockatoo Creek Australia
Score: 14 Give a positive score

Postby Game A Gogo » Wed Aug 17, 2005 12:30 am

wow :shock:
you know a lot about script
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Postby ondy1985 » Wed Aug 17, 2005 6:56 pm



Yes, the one of yours is much better. But I only did the one of mine in about 5 minutes, just to demonstrate the basic idea. I noticed that you had the same problem while adding 'Mouse Button Down' event to the "slider-knob" actor as you can't use empty script. But instead of your "x=x;" I used a comment "//no script" :)

Maybe Makslane could add a "draggable" actor property. If checked (or set to TRUE in script), the actor would be draggable. If unchecked (or set to FALSE), it wouldn't be draggable. Then maybe som new events, like "Drag" and "Drop". That would be neat.
User avatar
ondy1985
 
Posts: 99
Joined: Thu May 05, 2005 7:43 pm
Location: Slovakia
Score: 1 Give a positive score

Postby jazz_e_bob » Wed Aug 17, 2005 9:50 pm

Hi ondy1985.

Yeah. I like the idea of programming re-usable "modules".

On create sliderBacking you set the faders minimum value, maximum value and value. The rest takes care of itself.

To read the value simply use sliderTextValue.value.

Have a great day mate. :)
Controlling complexity is the essence of computer programming.
User avatar
jazz_e_bob
 
Posts: 742
Joined: Tue Jul 01, 2003 9:38 pm
Location: Bloke from Cockatoo Creek Australia
Score: 14 Give a positive score

Postby Joshua Worth » Sat Aug 20, 2005 9:02 am

can I steal your code, jazz_e_bob
Stay sweet
User avatar
Joshua Worth
 
Posts: 515
Joined: Tue Jul 19, 2005 12:00 am
Location: Stralia
Score: 5 Give a positive score

Postby jazz_e_bob » Sat Aug 20, 2005 10:07 am

Help yourself mate.

8)
Controlling complexity is the essence of computer programming.
User avatar
jazz_e_bob
 
Posts: 742
Joined: Tue Jul 01, 2003 9:38 pm
Location: Bloke from Cockatoo Creek Australia
Score: 14 Give a positive score

Postby Joshua Worth » Sat Aug 20, 2005 10:04 pm

kewl :wink:
Stay sweet
User avatar
Joshua Worth
 
Posts: 515
Joined: Tue Jul 19, 2005 12:00 am
Location: Stralia
Score: 5 Give a positive score

Postby Joshua Worth » Fri Sep 02, 2005 11:20 pm

jazz_e_bob: How do you locate it anywhere on the screen?
Stay sweet
User avatar
Joshua Worth
 
Posts: 515
Joined: Tue Jul 19, 2005 12:00 am
Location: Stralia
Score: 5 Give a positive score

Postby jazz_e_bob » Sat Sep 03, 2005 4:03 am

Unlock the parts and move the backing to where you want the slider to be.

( right-mouse click unlock )
Controlling complexity is the essence of computer programming.
User avatar
jazz_e_bob
 
Posts: 742
Joined: Tue Jul 01, 2003 9:38 pm
Location: Bloke from Cockatoo Creek Australia
Score: 14 Give a positive score

Postby Joshua Worth » Thu Sep 15, 2005 9:33 am

My brother does a lot of programing in C++. He made a simpler slider program: http://bubble.worth.id.au/~joshua/Game%20Editor/Jslider.zip
Stay sweet
User avatar
Joshua Worth
 
Posts: 515
Joined: Tue Jul 19, 2005 12:00 am
Location: Stralia
Score: 5 Give a positive score

Postby willg101 » Thu Sep 15, 2005 10:32 am

Nice! 8)
http://www.wish-games.com
Old betas now available!!
User avatar
willg101
 
Posts: 473
Joined: Thu Dec 16, 2004 12:08 am
Location: West Michigan
Score: 5 Give a positive score

Next

Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest