mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 15:52:40 +08:00
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:
@@ -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;
|
||||
},
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user