This document provides an introduction and overview of Corona SDK in Chinese. It discusses what Corona SDK is, how to develop apps faster with it, publishing to major platforms, its use of Lua scripting language, sample apps, APIs, forums, and demos. It also provides code examples for using images, touch input, sound, and physics in Corona apps.
36. local sky = display.newImage(“sky.png”)
local logo =
display.newImage(“corona.png”, 25, 65)
logo:setFillColor( 245, 132, 0)
37. local sky = display.newImage(“sky.png”)
local logo =
display.newImage(“corona.png”, 25, 65)
logo:setFillColor( 245, 132, 0)
logo:removeSelf()
logo = nil
38. local sky = display.newImage(“sky.png”)
local logo =
display.newImage(“corona.png”, 25, 65)
logo:setFillColor( 245, 132, 0)
logo:removeSelf()
logo = nil
local text =
display.newText( “Corona is Easy!”, 40, 35, “Helvetica”, 22 )
text:setTextColor( 255 )
40. local onTouch = function( event )
if event.phase = “began” then
local img = display.newImage
(“logo.png”, event.x, event.y)
end
end
41. local onTouch = function( event )
if event.phase = “began” then
local img = display.newImage
(“logo.png”, event.x, event.y)
end
end
Runtime:addEventListener( “touch”, onTouch)
42. local onTouch = function( event )
if event.phase = “began” then
local img = display.newImage
(“logo.png”, event.x, event.y)
end
end
Runtime:addEventListener( “touch”, onTouch)
43. local tapSound = audio.loadSound( “beep.mp3” )
local onTouch = function( event )
if event.phase = “began” then
local img = display.newImage
(“logo.png”, event.x, event.y)
audio.play( tapSound )
end
end
Runtime:addEventListener( “touch”, onTouch)