Reader small image

You're reading from  Corona SDK Mobile Game Development: Beginner's Guide

Product typeBook
Published inMar 2015
Publisher
ISBN-139781783559343
Edition1st Edition
Tools
Right arrow
Author (1)
Michelle M Fernandez
Michelle M Fernandez
Right arrow

Time for action – adding Twitter to your apps


We're going to implement Twitter in our apps by accessing a web service through UI buttons.

  1. In the Chapter 9 folder, copy the Twitter Web Pop-Up project folder to your desktop. All the configuration, libraries, and assets needed are already included. You can download the project files that accompany this book from the Packt Publishing website.

  2. Create a new main.lua file and save it to the project folder.

  3. Set the following variables at the beginning of the code:

    display.setStatusBar( display.HiddenStatusBar )
    
    local ui = require("ui")
    
    local openBtn
    local closeBtn
    local score = 100
  4. Create a local function called onOpenTouch() with an event parameter. Add an if statement so that the event receives a "release" action:

    local onOpenTouch = function( event )
      if event.phase == "release" then
  5. Using the local variable called message, add in the following string statement and concatenate score:

    local message = "Posting to Twitter from Corona SDK and got a final...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Corona SDK Mobile Game Development: Beginner's Guide
Published in: Mar 2015Publisher: ISBN-13: 9781783559343

Author (1)