画面をスクロールする CCNodeColor に CCLabelTTF があります。私の問題は、iPad Mini、iPhone 4、5、6 では完璧に見え、iPhone6+、iPad Air、iPad Retina では完全に間違っていることです。contentSizeType を変更しましたが、何も変わりません。現在のフォント サイズは 15.0f ですが、5.0f に下げると正しく動作します (ただし、小さすぎます)。また、奇妙なことに、フォントを 25.0f に変更すると、どのデバイスでも機能しなくなります。contentSize は NSString の長さに基づいているため、事前にわかりません。これはすべて SpriteBuilder で実行できますか? アプリの他の側面に SpriteBuilder を使用しています。最新の Cocos2d バージョンを使用しています。以下は画像とコードです。
self.tickerOne = [CCNodeColor nodeWithColor:[CCColor redColor]];
self.tickerTwo = [CCNodeColor nodeWithColor:[CCColor redColor]];
self.dataSourceArray = [self.dataSource setDataSourceArray];
NSString *stockTickerString = [self.dataSourceArray componentsJoinedByString:@" | "];
self.tickerOne.positionType = CCPositionTypeNormalized;
self.tickerOne.anchorPoint = ccp(0.5f,0.0f);
self.tickerOne.name = @"tickerOne";
CCLabelTTF *tickerLabel = [CCLabelTTF labelWithString:stockTickerString fontName:@"ArialMT" fontSize:**15.0f**];
tickerLabel.positionType = CCPositionTypeNormalized;
tickerLabel.anchorPoint = ccp(0.5f,0.5f);
tickerLabel.position = ccp(0.5f,0.5f);
tickerLabel.name = @"tickerLabel1";
self.contentSizeType = CCSizeTypePoints;
self.contentSize = CGSizeMake(tickerLabel.contentSize.width*1.5,tickerLabel.contentSize.height*2);
self.tickerOne.contentSize = self.contentSize;
[self addChild:self.tickerOne];
[self.tickerOne addChild:tickerLabel z:10];
これは、デバッグ領域で気づいたことです。私はこのようなもので完全に迷っています
OpenGL error GL_INVALID_VALUE detected at __28-[CCTexture setAntialiased:]_block_invoke 428
OpenGL error GL_INVALID_VALUE detected at -[CCGraphicsBufferGLUnsynchronized commit] 179
画像: iPad Retina ラベルのフォント サイズ 15.0f
画像: iPhone 6 ラベルのフォントサイズ 15.0f
画像: iPhone 6 ラベルのフォントサイズ 25.0f