开发者

how i can create my own CCTexture2D copying a piece of another CCTexture2D

I found how to repat single image to make a fitting background for my level:

[self setTextureRect:CGRectMake(0, 0, width, height)];
ccTexParams params = {GL_LINEAR,GL_LINEAR,GL_REPEAT,GL_REPEAT};
[self.texture setTexParameters:&params];

the problem is I must use a single.png image, and not a spritesheet.png + .plist file.

This because when i do [self setTextureRect:CGRectMake(0, 0, width, height)] for set my repeated background width, if the image is a spritesheet cocos2d take the other sprites in the spritesheet repeating and not only my b开发者_如何学Goackground sprite.

The question is: how i can create my own texture coping a piece of another texture??

thank you


Finally I solved the issue: Link to cocos2d forum question

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜