It's fast, but it should work with offsets to remove the positioning of the parallax node from the code.
It was a bit hard to found out how to reposition the child elements. First I tried to go throw them, and set the new position, but nothing happened. After 1 hour I started to dig into Cocos2D and came up with this solution:
for(unsigned int i=0; i < parallaxArray_->num; i++ ) {
[parallaxArray_->arr[i] setOffset:ccpAdd([parallaxArray_->arr[i] offset], offsetToAdd)];
}
0 comments:
Post a Comment