Repeating parallax using Cocos2D on Android
Posted
by
Saurabh Verma
on Stack Overflow
See other posts from Stack Overflow
or by Saurabh Verma
Published on 2011-12-19T16:43:38Z
Indexed on
2012/06/09
22:41 UTC
Read the original article
Hit count: 290
I want to draw a infinitely repeating parallax using Cocos2D on Android. Now, there are some solutions given to this problem in Objective C, but I'm stuck with my implementation in Android. I have tried using
CCSprite background = CCSprite.sprite("background_island.png");
CCTexParams params = new CCTexParams(GL10.GL_LINEAR,GL10.GL_LINEAR,GL10.GL_REPEAT,GL10.GL_REPEAT);
background.getTexture().setTexParameters(params);
But it only extends the background in 1 direction. I guess I have to use 2 sprites, such that as soon as 1st finishes, the other starts and vice versa, but I'm stuck with the implementation.
© Stack Overflow or respective owner