【问题标题】:How to set CustomFont for a CCLabel in COCOS2d-Android如何在 COCOS2d-Android 中为 CCLabel 设置 CustomFont
【发布时间】:2013-08-01 08:42:43
【问题描述】:

我需要在 COCOS2d-Android 中为 CCLabel 创建自定义字体。

currentVideoLabel = CCLabel.makeLabel(VideosLabels[currentSelected], "Faraco_Hand.ttf", winSize.width/41);
    currentVideoLabel.setPosition(CGPoint.make(winSize.width/2, 20));
    addChild(currentVideoLabel);

【问题讨论】:

  • 你应该看到 cocos2d-android 库中的基本问题的示例测试示例它会帮助你很多

标签: cocos2d-android


【解决方案1】:

下载一些ttf字体,在assets文件夹中创建一个名为Font的文件夹。然后将下载的ttf文件放在fonts文件夹中。你可以像这样在cclabel中使用字体

currentVideoLabel = CCLabel.makeLabel(VideosLabels[currentSelected], "Fonts/Faraco_Hand.ttf", winSize.width/41);

实际上,android 并不支持所有字体。不过你可以试试。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-03-05
    相关资源
    最近更新 更多