Advertisement
Hendrix000007

displayGroup tweaking

Feb 22nd, 2013
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.61 KB | None | 0 0
  1. -----------------------------------------
  2. -- DIPLAYGROUP TWEAKING TOGETHER WITH [SK]RAY
  3. -----------------------------------------
  4.  
  5. local myGroup = display.newGroup()
  6.  
  7. local ball1 = display.newImageRect ( "ball.png" )
  8. myGroup:insert( 1, ball1 )
  9.  
  10. local ball2 = display.newImageRect ( "ball.png" )
  11. myGroup:insert( 1, ball2 )
  12.  
  13. local ball3 = display.newImageRect ( "ball.png" )
  14. myGroup:insert( 1, ball3 )
  15.  
  16. myGroup:remove( ball2 ) -- NOW THE BALL AT PLACE 2 IN THE STACK IS REMOVES ITS 2 LEFT
  17. myGroup:insert(2, ball2 ) --[[ THOUGHT WE NOW HAVE BALL2 IN PLACE 2 OF THE STACK AND BALL3 WAS MOVED UP TO PLACE 3--]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement