These are the resolutions I’m using with the ultimate config.lua (Please let me know if I’m wrong)
360 * 570
1140 * 720
2280 * 1440
Hello guys … I’m creating a side scroller background. This is what my code looks like
bg1 = display.newImageRect("assets/images/bg1.png",\_W,\_H) bg1.x=0 bg2 = display.newImageRect("assets/images/bg2.png",\_W,\_H) bg2.x=\_W bg3 = display.newImageRect("assets/images/bg3.png",\_W,\_H) bg3.x=\_W\*2 bg4 = display.newImageRect("assets/images/bg4.png",\_W,\_H) bg4.x=\_W\*3 local function scrollWorld(self,event) if self.x \< -\_W then self.x = \_W\*3 else self.x = self.x - sceneSpeed - 10 end end bg1.enterFrame = scrollWorld; bg2.enterFrame = scrollWorld; bg3.enterFrame = scrollWorld; bg4.enterFrame = scrollWorld; Runtime:addEventListener("enterFrame", bg1) Runtime:addEventListener("enterFrame", bg2) Runtime:addEventListener("enterFrame", bg3) Runtime:addEventListener("enterFrame", bg4)
The code runs just fine but there’s a thin line (gap) appears between images. please help me remove those lines i.e. the images should appear seamless??
And I have one more doubt … is there a better way to do this because loading so many images (actually there are 15-18 backgroung images … yeah bg15 …) might cause difficulties for the actual devices to handle the texture memory … so any help regarding just loading the currently needed background images and scrolling them smoothly and seamlessly would be appreciated alot …Thanx 