Hexor / Simple-Corona-Button-Class-With-Touch-Effects

This is a button class that could make buttons using a image or rect, and when you push it, there will be effect on the button, and you also could set the button's callback function easily

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Something you shoud know before you start:

  1. Some basic knowledge in CoronaSDK
  2. OOP in CoronaSDK's Lua
  3. The event API in CoronaSDK.

What CAN this project DO?

This project is used for helping you make a simple button with the Corona-SDK.

You could use it in your own Corona Apps. And the code is really simple.

The below is what the button class is capable of:

  1. when user push the button, the image will be replaced by another highlight image, which could remind the user that the button has been pushed.

  2. when user's finger push the button and move the finger without leaving the screen, if user's finger is out of the button's range, the image will back be the origin one, and when finger goes in range again, the highlight image will be back.

  3. At the moment when user touch the button, a sound would be played to remind user.

  4. The button callback could be defined by the developer.

Once again, any bug report or suggestions are gladly welcome.

About

This is a button class that could make buttons using a image or rect, and when you push it, there will be effect on the button, and you also could set the button's callback function easily