Need help from the best

hey guys im trying to create one of the main elements of my game, and what i want to create is a slider (like a volume control on a track). I have looked at the simple mixer sample code and such but thats just so complex compared to what im looking to do. all i want is to create this slider that changes a variables value from 0 (when slid to the left) up to 100 ( when slid to the far right of the slider track) Can anyone help get me in the right direction? i just cant comprehend what needs to be done here for this. thank you very much in advance. [import]uid: 19620 topic_id: 6621 reply_id: 306621[/import]

http://www.youtube.com/watch?v=bQFwabcWog0 [import]uid: 6645 topic_id: 6621 reply_id: 23068[/import]

The very first listing in Code Exchange:
http://developer.anscamobile.com/code/customisable-slider [import]uid: 12108 topic_id: 6621 reply_id: 23071[/import]

Hmm ill have to look into that code exchange, i saw that already but i thought it was a slider thing like the Angry birds menu that lets you slide the level select screen from left to right.

thanks for the YOUTUBE link, that looks very helpful

PS- i knew that you two guys would respond because you guys are the pros around here =D [import]uid: 19620 topic_id: 6621 reply_id: 23077[/import]

K so the Coronaui thing sounds amazing, it is my understanding that this library has not been released yet, is this correct? i guess ill just have to wait for a while… wah wah [import]uid: 19620 topic_id: 6621 reply_id: 23124[/import]

As @jhocking says, take a look at the customisable slider - it can be configured in ways the ui elements are probably not meant to, in that it was expressly built for games.of course, the chrome of the new uii elements will be awesome! [import]uid: 8271 topic_id: 6621 reply_id: 23274[/import]

ok ill check it out, hopefully i can figure it out! ill report my findings here for anyone else that might need to create the same thing [import]uid: 19620 topic_id: 6621 reply_id: 23276[/import]

I just realized that you are the creator of the slider class, awesome! so i understand i will need to include the slider.lua in my game, is the code on the main page here: http://developer.anscamobile.com/code/customisable-slider

a type of template? im sorry for the questions im just not super experienced in lua yet. [import]uid: 19620 topic_id: 6621 reply_id: 23278[/import]

The code on that page is the full slider library. If you want a working example, complete with demo images, download the zip file - the main.lua should have enough in it to pretty much copy paste what you need.

One caveat: as stated, masking was not available when it was built, so you have to put the slider behind a hole in your image.

Depending on the coronaui lib I may or may not revamp it. I believe Ansca are building their new ui elements as lua code and not direct iOS controls so the can be manipulated as regular display objects - this would influence the decision, of course. [import]uid: 8271 topic_id: 6621 reply_id: 23280[/import]

Yea im working with that demo code right now, im just having a hard time disecting it how i want. i dont need anything fancy, just a track with a button on it that slides up and down changing a single variables value… would you mind giving me an example of this using your library? [import]uid: 19620 topic_id: 6621 reply_id: 23283[/import]

Just use the setup for the large slider at the top, but probably without the background images (in this case they repeat) and maybe give it just one of your own. Probably the hardest thing you’d have to do there is work out the size/pos of the hole and make the images.

m [import]uid: 8271 topic_id: 6621 reply_id: 23326[/import]