Cocos2d iphone 为什么cocos2d iphone v2、v3 x-v2 CCLabelBMFont对齐不居中?

Cocos2d iphone 为什么cocos2d iphone v2、v3 x-v2 CCLabelBMFont对齐不居中?,cocos2d-iphone,bitmap-fonts,cocos2d-iphone-2.x,Cocos2d Iphone,Bitmap Fonts,Cocos2d Iphone 2.x,我为所需的x64 ios更新了cocos2d iphone。 但我的游戏的CCLABELMFONT都去对齐错误。我怎样才能修好它 我设定 txt.anchorPoint = ccp(.25, .5); 成功了。但这不是真正的解决办法 这里是字体资源: 我编写调试代码: CGPoint basePot= ccp(0, 500); CGPoint offsetPot= ccp(0, 40); { basePot = ccpSub(basePot, offsetPot

我为所需的x64 ios更新了cocos2d iphone。 但我的游戏的CCLABELMFONT都去对齐错误。我怎样才能修好它

我设定

txt.anchorPoint = ccp(.25, .5);
成功了。但这不是真正的解决办法

这里是字体资源:

我编写调试代码:

CGPoint basePot= ccp(0, 500);
    CGPoint offsetPot= ccp(0, 40);
    {
        basePot = ccpSub(basePot, offsetPot);
        CCLabelBMFont *txt = [CCLabelBMFont labelWithString:@"12345654321" fntFile:@"font_finish_score.fnt"];
        txt.position=basePot;
        txt.anchorPoint = ccp(0, .5);
        [self addChild:txt];
    }
    {
        basePot = ccpSub(basePot, offsetPot);
        CCLabelBMFont *txt = [CCLabelBMFont labelWithString:@"12345654321" fntFile:@"font_finish_score.fnt"];
        txt.position=basePot;
        txt.anchorPoint = ccp(.5, .5);
        [self addChild:txt];
    }
    {
        basePot = ccpSub(basePot, offsetPot);
        CCLabelBMFont *txt = [CCLabelBMFont labelWithString:@"12345654321" fntFile:@"font_finish_score.fnt"];
        txt.position=basePot;
        txt.anchorPoint = ccp(1, .5);
        [self addChild:txt];
    }
    {
        basePot = ccpSub(basePot, offsetPot);
        CCLabelBMFont *txt = [CCLabelBMFont labelWithString:@"12345654321" fntFile:@"font_finish_score.fnt"];
        txt.position=basePot;
        txt.alignment = kCCTextAlignmentLeft;
        [self addChild:txt];
    }
    {
        basePot = ccpSub(basePot, offsetPot);
        CCLabelBMFont *txt = [CCLabelBMFont labelWithString:@"12345654321" fntFile:@"font_finish_score.fnt"];
        txt.position=basePot;
        txt.alignment = kCCTextAlignmentCenter;
        [self addChild:txt];
    }
    {
        basePot = ccpSub(basePot, offsetPot);
        CCLabelBMFont *txt = [CCLabelBMFont labelWithString:@"12345654321" fntFile:@"font_finish_score.fnt"];
        txt.position=basePot;
        txt.alignment = kCCTextAlignmentRight;
        [self addChild:txt];
    }

对齐不起作用,并且顶点(.5,.5)不是中心。困扰


我发现对齐不是智能。使用“Arial”测试_font.fnt效果良好。但是我的分数字体“HYZhongYuanJ”对齐不好。

您设置了标签的对齐方式吗?张贴标签设置代码,以及字体本身的详细信息(即是否为固定宽度?)@learncos2D我编写了一个测试调试代码,请帮助我检查它是否为cocos2d错误