2.x是不是用不了像素字体

给Label设置了像素字体后文字边缘还是虚的,有解决办法方案吗?不然只能自己去做位图字体了

let oldFunc4 = cc.Label.prototype.onEnable;
cc.Label.prototype.onEnable = function () {
    oldFunc4.call(this);
    if (this._assembler && !this._assembler._uploadTextureEx) {
        let oldFunction = this._assembler._uploadTexture;
        this._assembler._uploadTextureEx = true;
        this._assembler._uploadTexture = function (comp: cc.Label) {
            oldFunction.call(this, comp);
            if (comp.spriteFrame instanceof cc.SpriteFrame && comp.spriteFrame.texture) {
                // @ts-ignore
                comp.spriteFrame.texture.setFilters(cc.gfx.Filter.POINT, cc.gfx.Filter.POINT)
            }
        }
    }
}

3.x可以这样改

1赞