Better Buttons in Corona SDK - Tutorial

I’ve posted a 3-minute 40-second video online that shows a way to make a single button graphic look like it also has a depressed state (click and unclick):

http://instantvideowebpages.com/play/?m=645

But the best part about the code included with the tutorial is that it shows how to handle the case where the person’s finger is no longer over the button when it’s released.

It also shows a way to structure your code so handling multiple buttons on each screen is very simple.

The video is just “out there” but if you want a PD download of the detailed article plus the sample code, you have to be a member of GameDevNation.com – which is free. There’s a link on that video page above.

Enjoy!

Jay
[import]uid: 9440 topic_id: 10042 reply_id: 310042[/import]

Thanks Jay. Can be very annoying in an app when you are pressing a button but not sure if you got the right one, or if you pressed it at all. On a user-friendly standpoint this should be put into all apps. [import]uid: 31262 topic_id: 10042 reply_id: 36837[/import]

From a developer standpoint I always hate putting in that kind of stuff because it seems useless – it’s not really part of the game, after all. But it does makes a game more polished and friendly for the user, which can be a big factor in whether they tell others about the game or buy your next one.

Since I hated messing with it, I decided to go ahead and make something fairly generic that I can *easily* use i all future projects. That article and sample code is the result.

Thanks!

Jay [import]uid: 9440 topic_id: 10042 reply_id: 36867[/import]

I have added a button to run a character in my game. But i have to press it again and again to run my character my 1 step. I want it to run until i stop pressing the button, like we have in famous games like mario. You just need to press a forward button to run your character and until you stop pressing your character runs continuously. [import]uid: 63289 topic_id: 10042 reply_id: 38674[/import]

You would have to make it loop the function [import]uid: 79135 topic_id: 10042 reply_id: 52113[/import]