I have got the code to repeat X- and Y- which is:
bg = [CCSprite spriteWithFile:@"ipadbgpattern.png" rect:CGRectMake(0, 0, 3000, 3000)];
bg.position = ccp(500,500);
ccTexParams params = {GL_LINEAR,GL_LINEAR,GL_REPEAT,GL_REPEAT};
[bg.texture setTexParameters:¶ms];
[self addChild:bg];
However, I do not know how to change the params in order for the background to repeat along the horizontal axis.
There's no parameter for that. Just make sure the CGRect spans the region where you want the texture to repeat, and the texture itself must be a power of two (ie 1024x1024).
I'm guessing that maybe you're using a 1024x768 texture and then you'll see a gap between texture repeats.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With