【问题标题】:how i can create my own CCTexture2D copying a piece of another CCTexture2D我如何创建自己的 Texture2D 复制另一个 Texture2D
【发布时间】:2011-04-30 01:25:56
【问题描述】:

我找到了如何复制单个图像来为我的关卡制作合适的背景:

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

问题是我必须使用 single.png 图像,而不是 spritesheet.png + .plist 文件。

这是因为当我 [self setTextureRect:CGRectMake(0, 0, width, height)] 设置我重复的背景宽度时,如果图像是 spritesheet cocos2d 会重复 spritesheet 中的其他 sprite 而不仅仅是我的背景 sprite。

问题是:我如何创建自己的纹理来处理另一个纹理??

谢谢

【问题讨论】:

    标签: objective-c ios cocos2d-iphone textures texture2d


    【解决方案1】:

    最后我解决了这个问题: Link to cocos2d forum question

    【讨论】:

      猜你喜欢
      • 2017-11-29
      • 2013-01-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-10-22
      • 2015-06-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多