首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >CCRenderTexture anchorPoint还是什么?

CCRenderTexture anchorPoint还是什么?
EN

Stack Overflow用户
提问于 2014-04-07 03:53:13
回答 1查看 136关注 0票数 0

我需要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

我找到了这些答案,但没有帮助。这个位置有没有可能改变?

EN

回答 1

Stack Overflow用户

发布于 2014-04-07 16:46:55

检查这是否对你有帮助。请注意,如果您想要将其用作UIIMage,则UIImage是可选的。

代码语言:javascript
复制
    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];
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/22899170

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档