第一天学习收获corona

音频audio
local fireSound = audio.loadSound( "audio/fire.wav" )
audio.play( explosionSound )

场景composer
scene:create()
scene:show()scene:hide()scene:destroy()
local composer = require( "composer" )
引用场景对象composer.getscene
local titleScene = composer.getScene( "titleScene" )
titleScene.getUserPrefs()
引用全局数据
-- Set the Composer variable "money" to 100
composer.setVariable( "money", 100 )
-- In another scene...
local currentMoney = composer.getVariable( "money" )
此函数在Composer模块中设置一个变量,您可以通过composer.getVariable()从任何其他场景访问该
变量。

composer.setVariable( "finalScore", score )

动画easing
local circle = display.newCircle( 100, 100, 40 )
circle:setFillColor( 0, 0, 1 )
transition.to( circle, { time=400, y=200, transition=easing.inExpo } )

画形状display.newCircle圆
local myCircle = display.newCircle( 100, 100, 30 )
myCircle:setFillColor( 0.5 )
myCircle.strokeWidth = 5
myCircle:setStrokeColor( 1, 0, 0 )
【local square = display.newRect( 0, 0, 100, 100 )】
【display.newRoundedRect( [parent,] x, y, width, height, cornerRadius )】圆角矩形

widget
滚动视图widget.newScrollView()
按钮widget.newButton()

你可能感兴趣的:(第一天学习收获corona)