Apparently, you can use Cocos2d-js 3.0 RC3 cc.LabelTTFwith custom fonts, for example, as answered here . However, this does not produce any results for me, neither in the local JSBinding application, nor in the web browser.
A font file was included in the object res:
var res = {
lobster_ttf: "res/Lobster.ttf"
};
var g_resources = [];
for (var i in res) {
g_resources.push(res[i]);
}
Lobster.ttfexists in the directory res.
The label is created as follows:
var label = new cc.LabelTTF("labeltext", res.lobster_ttf, 48);
Doing this does not display the label in the specified font, but in the default font. However, specifying the installed font instead of the custom ttf path works.
Is additional work required to use TTF files?
source
share