fixed WeChat playform can't identify the ttf font format problem

fixed ParticleSystem part memory  leak problem


fixed the wechat can't identify ttf format problem


s


fixed WeChat playform can't identify the ttf font format problem


fixed WeChat playform can't identify the ttf font format problem


s
This commit is contained in:
Cocos Ass
2018-04-08 18:38:30 +08:00
parent c2304a0030
commit 133e1d9846
2 changed files with 14 additions and 3 deletions
+13 -3
View File
@@ -490,13 +490,23 @@ _ccsg.Label = _ccsg.Node.extend({
_loadTTFFont: function(fontHandle) {
var self = this;
var fontFamilyName = cc.CustomFontLoader._getFontFamily(fontHandle);
var callback = function () {
self._notifyLabelSkinDirty();
self.emit('load');
};
cc.CustomFontLoader.loadTTF(fontHandle, callback);
var fontFamilyName = "";
if (CC_WECHATGAME) {
fontFamilyName = wx.loadFont(fontHandle);
//avoid the error in wechat devtool platform
if (!fontFamilyName) {
fontFamilyName = cc.CustomFontLoader._getFontFamily(fontHandle);
}
callback();
} else {
fontFamilyName = cc.CustomFontLoader._getFontFamily(fontHandle);
cc.CustomFontLoader.loadTTF(fontHandle, callback);
}
return fontFamilyName;
},
+1
View File
@@ -349,6 +349,7 @@ _ccsg.ParticleSystem = _ccsg.Node.extend({
this.scheduleUpdateWithPriority(1);
_ccsg.Node.prototype.onEnter.call(this);
},
/**
* This is a hack function for performance, it's only available on Canvas mode. <br/>
* It's very expensive to change color on Canvas mode, so if set it to true, particle system will ignore the changing color operation.