I’m trying to implement infinite scroll using parallaxnodes.
What I came up with (q&d) is to create 2 instances of the background, and as soon as one is outside of the screen, reposition it at the end of the other.
My ParallaxNode has both elements added, but when I try to use setPosition in any of them nothing happens. I also tried removing them from the childList, then re-adding them in a new position, but the program crashes as it breaks the rule of “not the same child node twice”.
I have done it by creating new sprites and adding them at the offset position, but as I want an unlimited amount I need some kind of control variable on when to add a new one. None of the getPosition() for either the parallaxnode or any of the nodes seems to give a sensible value and I cannot find a class member that stores the scroll position at any given time.