0

私が取り組んでいるプロジェクトでは、次のことを行っています。

CCLabelBMFont *howtoplayGameLabelFont = [CCLabelBMFont labelWithString:@"HOW TO PLAY" fntFile:font];
[howtoplayGameLabelFont setFontsize:fontSize];

CCMenuItemLabel *howtoplayGameLabel = [CCMenuItemLabel itemWithLabel:howtoplayGameLabelFont target:self selector:@selector(startHowToPlay:)];

CCMenu *bottomMenu = [CCMenu menuWithItems:howtoplayGameLabel,creditsGameLabel, nil];
[bottomMenu alignItemsVerticallyWithPadding:padding];
[bottomMenu setPosition:ccp( size.width/2 + bottomXOffSet, size.height/2 + bottomYOffSet)];

[self addChild: bottomMenu z:10];

非 Retina ディスプレイの場合、ラベル全体をクリックできますが、Retina ディスプレイの場合、ラベルの非常に小さなセクションをクリックできます。

これをどのように修正しますか?

CCMenuItemLabel に setFontSize のコードを追加したことをすっかり忘れていました。ここにあります:

-(void)setFontsize:(float)fontsize
{
    Fontsize_   = fontsize * CC_CONTENT_SCALE_FACTOR();
    self.scale = (Fontsize_ / OriginalFontsize_);
}
4

0 に答える 0