the*_*tic 5 iphone textures objective-c cocos2d-iphone ipad
我有代码重复X-和Y-这是:
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];
Run Code Online (Sandbox Code Playgroud)
但是,我不知道如何更改参数以使背景沿水平轴重复.
没有这个参数。只需确保 CGRect 跨越您希望纹理重复的区域,并且纹理本身必须是 2 的幂(即 1024x1024)。
我猜您可能使用的是 1024x768 纹理,然后您会看到纹理重复之间存在间隙。
| 归档时间: |
|
| 查看次数: |
1444 次 |
| 最近记录: |