人々が線を引くことができるように、「ホワイトボード」を追加しようとしています。
唯一の問題は、私が非常に速く描画すると、スプライトがかなり離れた場所に配置されるため、文字や数字を描画しようとしてもほとんど判読できないことです。異なるスプライトの間にはたくさんのスペースがあります。
これが私の方法で、ほとんどの描画が行われていると思います。
-(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];
ただし、更新間の時間を短縮する方法は完全にはわかりません。
前もって感謝します