refactor: smooth text

This commit is contained in:
cha0s 2021-01-21 20:04:45 -06:00
parent 951b7e4f90
commit 7029839d7e

View File

@ -1,3 +1,5 @@
import {SCALE_MODES} from '@pixi/constants';
import Renderable from './renderable';
export default class Text extends Renderable {
@ -7,7 +9,10 @@ export default class Text extends Renderable {
if ('client' === process.env.SIDE) {
// eslint-disable-next-line global-require
const {Text: PIXIText} = require('@pixi/text');
this.text = new PIXIText(text, style);
const pixiText = new PIXIText(text, style);
pixiText.updateText();
pixiText.texture.baseTexture.scaleMode = SCALE_MODES.LINEAR;
this.text = pixiText;
}
else {
this.text = {