设置系统字体(TTF FontName)

kink_han
Fri, 17 Jun 2016 08:28:21 +0000

cc.Class({
extends: cc.Component,

properties: {
    fontName:{
        default:"PingFang SC",
        type:cc.String
    }
},

// use this for initialization
onLoad: function () {
    var label = this.node.getComponent(cc.Label);
    if(label){
        label._sgNode.setSystemFontName(this.fontName);
    }
    this.enabled = false;
},

});

阅读整个主题