Search code examples
cocos2d-android

How to set CustomFont for a CCLabel in COCOS2d-Android


I need to Create Custom Font for CCLabel in COCOS2d-Android.

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

Solution

  • download some ttf font , create a folder called Font in assets folder.then place the downloaded ttf file in fonts folder.You can use the font in cclabel like this

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

    actually all fonts are not supported in android. but you may try some.