On Touch, open new Lua document

Keep in mind that I am extremely new to iOS development and the Lua language, I come from a web development background.

What I'm trying to accomplish is, that when the user taps anywhere on the screen, then a new Lua document will be displayed.

For instance, on the splash screen there is text that says "Touch here to continue"

1
local ttc = display.newText( "Touch to continue.", 160, 800, "font", 50 )

Hi, it depends on your framework but the idea is basically this:

1
2
3
4
5
6
7
8
9
10
11
12
13
local function loadLevel(event)
  if event.phase == "ended" then
    -- cleanup, init, ...
 
    -- load level
    local level = require(levelFile)
    level.load() -- or whatever
  end
end
 
local ttc = display.newText( "Touch to continue.", 160, 800, "font", 50 )
 
ttc:addEventListener( "touch", loadLevel )
views:1363 update:2011/10/5 21:23:48
corona forums © 2003-2011