Hello,
I’ve got a problem that doesn’t occur in the simulator or on an Android device - it only occurs on iOS.
I have a an “infinite” scrolling background where I place one behind the other every time one goes off the screen. I create the background like this:
local backgroundOverlay = {}--display.newImageRect(bgOverlayLocation,w,h),display.newImageRect(bgOverlayLocation,w,h)} for i = 1, numThemes + 2 do table.insert(backgroundOverlay,display.newImageRect(bgOverlayLocation,w,h)); backgroundOverlay[i].anchorX = 0; backgroundOverlay[i].anchorY = 0; backgroundOverlay[i].alpha = .7 backgroundOverlay[i].y = 0 ; backgroundOverlay[i].x = (i-1)\*w + screenOriginX; group:insert(backgroundOverlay[i]); end
Then in my Enter Scene
function, I run the scrollBackground() function every time which looks like this:
function scrollBackgroun() for i = 1, #backgroundOverlay do backgroundOverlay[i]:translate(-t\*cloudMoveSpeed,0); end end
It works just as it should on Android and both iOS and Android Simulators, but throws an exception in iOS saying ‘Attempt to call method ‘translate’ a nill value’;
I’m sure I did something wrong, but I can’t seem to figure out what. If you have any pointers as to where to go next, I’d appreciate it.