标签:
----------------------------------------------------------------------------------------- -- -- main.lua -- ----------------------------------------------------------------------------------------- local squares = display.newGroup() local redSquare1 = display.newRect( squares, 0, 0, 40, 40 ) local redSquare2 = display.newRect( squares, 0, 0, 40, 40 ) local redSquare3 = display.newRect( squares, 0, 0, 40, 40 ) redSquare1:setFillColor( 1, 0, 0 ) redSquare2:setFillColor( 1, 0, 0 ) redSquare3:setFillColor( 1, 0, 0 ) --insert only the red squares into a table local redSquares = { redSquare1, redSquare2, redSquare3 } for i = 1, #redSquares do --manipulate the square at the current index (i) redSquares[i].x = redSquares[i].x + i*100 redSquares[i]:scale( 0.5, 0.5 ) end
标签:
原文地址:http://www.cnblogs.com/yufenghou/p/4423925.html