Custom Slide bar

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
unclewayne
Posts: 37
Joined: Tue Apr 05, 2011 9:58 pm

Custom Slide bar

Post by unclewayne » Mon Apr 25, 2011 4:54 pm

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.
Attachments
Slider.zip
(14.33 KiB) Downloaded 353 times

dburdan
Posts: 104
Joined: Fri Jan 28, 2011 5:39 am
Location: California, USA

Re: Custom Slide bar

Post by dburdan » Mon Apr 25, 2011 5:28 pm

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.
Last edited by dburdan on Fri Nov 07, 2014 8:32 pm, edited 1 time in total.

unclewayne
Posts: 37
Joined: Tue Apr 05, 2011 9:58 pm

Re: Custom Slide bar

Post by unclewayne » Mon Apr 25, 2011 5:51 pm

Great. So i need Animation Engine to do this? I can't wait to see the tutorial.
Do you do any freelance?

dburdan
Posts: 104
Joined: Fri Jan 28, 2011 5:39 am
Location: California, USA

Re: Custom Slide bar

Post by dburdan » Mon Apr 25, 2011 9:58 pm

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.
Last edited by dburdan on Fri Nov 07, 2014 8:33 pm, edited 1 time in total.

andyh1234
Posts: 442
Joined: Mon Aug 13, 2007 4:44 pm
Location: Eccles UK
Contact:

Re: Custom Slide bar

Post by andyh1234 » Tue Apr 26, 2011 12:31 am

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.

Danny
Posts: 106
Joined: Tue Nov 09, 2010 1:28 am

Re: Custom Slide bar

Post by Danny » Wed Apr 27, 2011 5:21 am

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

dburdan
Posts: 104
Joined: Fri Jan 28, 2011 5:39 am
Location: California, USA

Re: Custom Slide bar

Post by dburdan » Wed Apr 27, 2011 8:07 pm

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!

Post Reply

Return to “iOS Deployment”