0
我试图用的cocos2d做滚动层垂直滚动CCLayerColor问题
我想是该层开始从上往下滚动,但无论何时进入现场层我做什么位于(0,0)aka..bottom
我试了几件事情,但似乎没有任何工作
-(id) init
{
if((self=[super init])) {
self.isTouchEnabled = YES;
isDragging = NO;
yvel = 0.0f;
contentHeight = 1000.0f;
scrollLayer = [CCLayerColor layerWithColor:ccc4(200, 200, 200, 240)];
scrollLayer.contentSize = CGSizeMake(320,contentHeight);
scrollLayer.anchorPoint = ccp(0,1);
scrollLayer.position = ccp(0, 480);
[self addChild: scrollLayer];
CCLabelTTF *label = [CCLabelTTF labelWithString:[NSString stringWithFormat:@"test label"]
fontName:@"Marker Felt"
fontSize:24];
label.position=ccp(100, 100);
[scrollLayer addChild:label];
[self scheduleUpdate];
}
return self;
}
其他方法更新,触动的处理器,这样的问题不能be there
与此代码...不应该它与屏幕左上角的内容初始化?一个痛苦的几个小时,我终于解决了这个问题后