Cocos2d-JSでカスタムttfフォントを使用する
準備
iosの場合は下記の記事にあるように
http://kyokomi.hatenablog.com/entries/2014/01/07
Fonts provided by application を追加する必要がある。
設置方法
下記のような感じ。
// テキスト配置 var label; if(cc.sys.OS_ANDROID === cc.sys.os){ label = cc.LabelTTF.create("Alignment 0\nnew line\n!!", "res/fonts/Abduction.ttf", 24); } else { label = cc.LabelTTF.create("Alignment 0\nnew line\n!!", "Abduction", 24); } some_layer.addChild(label, 127, "label"); label.color = cc.color(0, 0, 0); label.x = 640; label.y = 500; label.opacity = 255;