我正在尝试添加一个“白板”,以便人们可以在上面画线。
唯一的问题是,如果我画得非常快,它会将精灵间隔得很远,所以如果他们试图画字母或数字,它甚至都难以辨认。不同的精灵之间有很多空间。
这是我认为大部分绘图发生的方法。
-(void) update:(ccTime)delta
    {
        CCDirector* director = [CCDirector sharedDirector];
        CCRenderTexture* rtx = (CCRenderTexture*)[self getChildByTag:1];
        // explicitly don't clear the rendertexture
        [rtx begin];
        for (UITouch* touch in touches)
        {
            CGPoint touchLocation = [director convertToGL:[touch locationInView:director.openGLView]];
touchLocation = [rtx.sprite convertToNodeSpace:touchLocation];
        // because the rendertexture sprite is flipped along its Y axis the Y coordinate must be flipped:
        touchLocation.y = rtx.sprite.contentSize.height - touchLocation.y;
        CCSprite* sprite = [[CCSprite alloc] initWithFile:@"Cube_Ones.png"];
        sprite.position = touchLocation;
        sprite.scale = 0.1f;
        [self addChild:sprite];
        [placedSprites addObject:sprite];
    }
    [rtx end];
}
Maybe this is the cause?
[self scheduleUpdate];  
我不完全确定如何减少更新之间的时间。
提前致谢