Page 1 of 1

Custom Slide bar

Posted: Mon Apr 25, 2011 4:54 pm
by unclewayne
Hey Guys,
First off, thanks for all the help.
Basically what i am trying to do is create a custom slider, like the unlock slider on the iphone. I attached my file for reference. I would like to have "HANDLE.gif" start at the bottom of the grey box ("1" on the start value) and slide vertically. if you let go at any point it will bounce back to the bottom, if you make it to the top ("100" on the end value) it will produce "---.png". Any help would be greatly appreciated.
Thanks Again.

Re: Custom Slide bar

Posted: Mon Apr 25, 2011 5:28 pm
by dburdan
Hello Wayne,

This should be very easiy to accomplish. Once you have the "slider.png" and a "bg.png" then it should only take a matter of minutes.

1) Have a look at this link: http://intkeystrokes.posterous.com/cust ... th-animati. It will show you how to create a basic slider with AE4. This will lead you in the right direction, then from there you can customize all of the settings to suit your needs.
2) You can use the slider distance to determine if it has reached the end, for example:

Code: Select all

   
get distance(the location of graphic "SliderStart", the location of graphic "sliderb")
put it into SliderDistance
divide SliderDistance by 200

switch sliderDistance
   case 50 //Just an example
         move graphic "slider" to 20,50 in 200 milliseconds //Again, just example numbers. but this should give you the general idea.
end switch
All of this code will make sense once you watch that video. Later tonight I will post a tutorial and stack on how to do the whole thing.

Re: Custom Slide bar

Posted: Mon Apr 25, 2011 5:51 pm
by unclewayne
Great. So i need Animation Engine to do this? I can't wait to see the tutorial.
Do you do any freelance?

Re: Custom Slide bar

Posted: Mon Apr 25, 2011 9:58 pm
by dburdan
Wayne,
I'm sure there is a way to do this without Animation Engine but it streamlines the process very well and makes it so much more simple. Yes, I currently do very much freelance.

Re: Custom Slide bar

Posted: Tue Apr 26, 2011 12:31 am
by andyh1234
Id just add a quick note of support for animation engine as well, just completed an iOS app where ive emulated a few controls and AE makes life a lot simpler.

Re: Custom Slide bar

Posted: Wed Apr 27, 2011 5:21 am
by Danny
Hey Andy and Darci,
I posted a question on the Animantion Engine section of the forums http://forums.runrev.com/viewtopic.php?f=27&t=7336

But to summarize it I wanted to know if AE will make my game run smoother with AE comands rather than LivCode commands? I realize that I still have to go through my game and look to optimize the current code. I mean is AE just make life easier or does it perform comands more efficient?

If you can answer these questions please post on the AE Forums as I don't think this is the correct area for the post.

Danny

Re: Custom Slide bar

Posted: Wed Apr 27, 2011 8:07 pm
by dburdan
Danny,
I'm not entirely sure if AE runs the code smoother although it seems as if it does. My main reason for using it is the fact that it makes life WAY easier. It is so much more simple to include AE and run 2 lines of code opposed to 15.

I however, am also experiencing lag with my app. I'm not sure if my code isn't very efficient or if there is something else behind the issue. If I happen to come across an answer I will be sure to let you know!