Last active
August 29, 2015 14:10
-
-
Save ferminhg/a035e94045c056a26d5c to your computer and use it in GitHub Desktop.
Corona SDK - Creating Button
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| local widget = require("widget") | |
| --Function to handle button events | |
| local function handleButtonEvent( event ) | |
| local phase = event.phase | |
| if "ended" == phase then | |
| print( "You pressed and released a button!") | |
| end | |
| end | |
| --Create the buttond | |
| local myButton = widget.newButton | |
| { | |
| left = 150, | |
| top = 200, | |
| width = 350, | |
| height = 150, | |
| defaultFile = "cerdito.png", | |
| label = "Wopwop", | |
| onEvent = handleButtonEvent, | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment