重写 ccui.text 的clone方法。修复clone字体描边

来源:互联网 发布:字符数组结束标志 编辑:程序博客网 时间:2024/05/20 09:22
_copySpecialProperties()方法中增加下面一行,可以克隆字体描边
if(uiLabel._labelRenderer && uiLabel._labelRenderer._strokeEnabled){            this.enableOutline(uiLabel._labelRenderer._strokeColor,uiLabel._labelRenderer._strokeSize);

_copySpecialProperties: function (uiLabel) {    if(uiLabel instanceof ccui.Text){        this.setFontName(uiLabel._fontName);        this.setFontSize(uiLabel.getFontSize());        this.setString(uiLabel.getString());        this.setTouchScaleChangeEnabled(uiLabel.touchScaleEnabled);        this.setTextAreaSize(uiLabel._textAreaSize);        this.setTextHorizontalAlignment(uiLabel._labelRenderer.getHorizontalAlignment());        this.setTextVerticalAlignment(uiLabel._labelRenderer.getVerticalAlignment());        this.setContentSize(uiLabel.getContentSize());        this.setTextColor(uiLabel.getTextColor());        if(uiLabel._labelRenderer && uiLabel._labelRenderer._strokeEnabled){            this.enableOutline(uiLabel._labelRenderer._strokeColor,uiLabel._labelRenderer._strokeSize);        }    }},