Advertisement
Rakoonic

Changing the origin of the screen to allow for some effects

Sep 4th, 2013
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.51 KB | None | 0 0
  1. -- Create the parent group
  2. local parentGroup = display.newGroup()
  3. sceneGroup:insert( parentGroup )
  4. parentGroup.x = math.floor( display.contentWidth / 2 )
  5. parentGroup.y = math.floor( display.contentHeight / 2 )
  6.  
  7. -- Create the child group
  8. local childGroup = display.newGroup()
  9. parentGroup:insert( childGroup )
  10. childGroup.x = -parentGroup.x
  11. childGroup.y = -parentGroup.y
  12.  
  13. -- Now insert your game group into the child
  14. childGroup:insert( yourGameGroup )
  15.  
  16. -- Now manipulate childGroup directly, eg xScale, rotation...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement