我需要CCRenderTexture (白色矩形)来渲染我的雪碧图(第一张图片),但它只渲染在左下角(第二张图片)。如何更改此值?
First picture
Second Picture
renderTextrure.position = ccp(p.x,p.y);
renderTexture.sprite.position = ccp(p.x,p.y);
renderTexture.sprite.anchorPoint = ccp(0.5,0.5);
编辑
CCRenderTexture initial position
CCRenderTexture size and position in Cocos2d-iphone
我找到了这些答案,但没有帮助。这个位置有没有可能改变?
发布于 2014-04-07 16:46:55
检查这是否对你有帮助。请注意,如果您想要将其用作UIIMage,则UIImage是可选的。
CCRenderTexture *renderer = [CCRenderTexture renderTextureWithWidth:tx height:ty pixelFormat:kCCTexture2DPixelFormat_RGBA8888 depthStencilFormat:GL_DEPTH24_STENCIL8];
[renderer beginWithClear:0 g:0 b:0 a:0 depth:1.0f];
[1st_pic_sprite visit];
[renderer end];
UIImage *img = [renderer getUIImage];https://stackoverflow.com/questions/22899170
复制相似问题