Hello,
I currently have a scrolling background working by using something similar to the example in Texture2dText.m
The code is as follows...
CCSprite *sprite = [CCSprite spriteWithFile:@"pattern1.png" rect:CGRectMake(0, 0, 4096, 4096)];
[self addChild:sprite z:-1 tag:kTagSprite1];
[sprite setPosition:ccp(size.width/2,size.height/2)];
ccTexParams params = {GL_LINEAR,GL_LINEAR,GL_REPEAT,GL_REPEAT};
[sprite.texture setTexParameters:¶ms];
I'm wondering if there's any way to make a texture that is two images merged together, then use this example to make the repeating texture.
I'm using an image that is 1024 in width, and some given height. Lets say it's 512. Either way, the widths are squares.
So, I'm using 1024 for the width, as it's the max size for the 3G if I'm not mistaken, and I want my game to be available for 3G.
Now, the only problem is, my scrolling background will be moving fast, so I want to have a background that is at least 2048 in width. I'm ok with using 2048.
So, the question is, can I merge two images that are 1024 width together, to make a texture that is 2048, then use the above to repeat the 2048 image for the total background for scrolling?
I searched the forums but couldn't find much. I found a few similar posts, but couldn't find an answer.
If anyone could help be, I would really appreciate it!
EDIT:
I feel I didn't explain this well.
I'm trying to do this....
I have two images that are 1024 in width. They fit together in order to make a continuous background that is 2048 wide.
I want to merge both images to create one texture that is 2048.
Can I do this?
After that I want to use the above method to create a repeating texture so I can move it to make a seemingly endless scrolling background.
Can I do this as well?
Thanks!