CCRenderTexture初始位置 [英] CCRenderTexture initial position

查看:337
本文介绍了CCRenderTexture初始位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在cocos2d中为iphone设备更改CCRenderTexture的初始位置。当我设置矩形的高度和宽度时,它总是从0,0,0的屏幕左下角,但是我需要渲染到一个sprite不在那个区域。

How can i change the initial position of a CCRenderTexture within cocos2d for iphone device. When ever I set the height and width of the rectangle it is always from the bottom left of the screen at point 0,0 but the area i need to render to a sprite is not in that area.

CGSize s = [[CCDirector sharedDirector] winSize];
miniMap = [[CCRenderTexture renderTextureWithWidth:columns*30  height:rows*30] retain];

[miniMap begin];
[self visit];
[miniMap end];

map = [miniMap sprite];
map.scale = 0.15;
map.scaleY *= -1;
map.position = ccp(s.width/2-60,100);
[map setAnchorPoint:ccp(0,0)];

是一个例子。我已经尝试移动小地图和地图位置在屏幕周围,但不是与期望的结果。任何想法如何改变ccrendertexture使用其高度和宽度的初始位置?

above is an example of what im trying. i have tried moving the minimap and map position around the screen but not with the desired results. Any ideas how how to change the initial position that the ccrendertexture uses its height and width from?

推荐答案

在cocos2d论坛。只是共享incase任何人有相同的问题
http://www.cocos2d-iphone。 org / forum / topic / 18796

i got answer at this link on cocos2d forum. just sharing incase anyone has same issue http://www.cocos2d-iphone.org/forum/topic/18796

这篇关于CCRenderTexture初始位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆