Advertisement
lvs

Build background

lvs
Apr 30th, 2013
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.38 KB | None | 0 0
  1. function _M:buildBackground(group)
  2.     local w, h = 200, 200
  3.     local W, H = math.floor(display.viewableContentWidth / w), math.floor(display.viewableContentHeight / h)
  4.     for y = 0, H + 1 do
  5.         for x = 0, W + 1 do
  6.             local img = display.newImageRect(group, 'images/background.png', w, h)
  7.             img.x, img.y = x * w + _L, y * h + _T
  8.         end
  9.     end
  10. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement