refactor: smooth text
This commit is contained in:
parent
951b7e4f90
commit
7029839d7e
|
@ -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 = {
|
||||
|
|
Loading…
Reference in New Issue
Block a user