Cocos2d-js: How to use a custom ttf font on android devices?

前端 未结 2 1580
醉话见心
醉话见心 2021-01-19 00:52

I use following code to display a custom ttf font:

ml.score = cc.LabelTTF.create(ml.totalPoints.toString(), \"fonts/American Typewriter.ttf\", 60);
ml.score.         


        
2条回答
  •  南方客
    南方客 (楼主)
    2021-01-19 01:50

    I made a mistake. The file name was wrong. It should be

    ml.score = cc.LabelTTF.create(ml.totalPoints.toString(), "res/fonts/American Typewriter.ttf", 60);
    

    Otherwise the code works fine. (shame ...)

提交回复
热议问题