Hi guys,
I have 3 scrolling portrait backgrounds 640x960. They scroll down and then translate back up to -y when out of picture. The first time they scroll through its fine but then only bg2 & 3 keep scrolling and I get a black gap at the top every rotation. It looks like bg2 is going over bg1 but I cant work out why…any ideas?
local bg1 = display.newImageRect("images/grass1.png", 320, 480) bg1.anchorX = 0 --bg1.x = 0 bg1.y = \_H/2 local bg2 = display.newImageRect("images/grass2.png", 320, 480) bg2.anchorX = 0 --bg2.x = 0 bg2.y = bg1.y - 480 local bg3 = display.newImageRect("images/grass3.png", 320, 480) bg3.anchorX = 0 --bg3.x = 0 bg3.y = bg2.y - 480 local function screenMove(event) bg1.y = bg1.y + scrollSpeed bg2.y = bg2.y + scrollSpeed bg3.y = bg3.y + scrollSpeed if (bg1.y + bg1.contentWidth) \> 1200 then bg1:translate( 0, -960 ) end if (bg2.y + bg2.contentWidth) \> 1200 then bg2:translate( 0, -960 ) end if (bg3.y + bg3.contentWidth) \> 1200 then bg3:translate( 0, -960 ) end end