Hello!
At the moment I teach PIXI, there is a question. Suppose we have a canvas element managed by pixi. It contains the text. The canvas itself is in a block that, when scrolled, acquires a certain translate. So, during this scrolling, the text in the canvas jumps.
Can I somehow solve this problem?
Adding text
let app = new PIXI.Application({ width: 500, height: 500, antialias: true, transparent: true, view: canvas // canvas элемент }); let stage = app.stage; app.renderer.autoResize = true; let style = new PIXI.TextStyle({ fontFamily: 'AvertaCY', fontSize: parseInt(getComputedStyle(el).getPropertyValue("font-size")), lineHeight: parseInt(getComputedStyle(el).getPropertyValue("line-height")), fontStyle: 'normal', fontWeight: '600', fill: obj.color, strokeThickness: 0, wordWrap: true, wordWrapWidth: width // определенная ширина }); let text = new PIXI.Text(el.innerText, style); text.x = 5; text.y = 5; stage.addChild(text); Block movement
div.style.transform = `translate(${x}px, ${y}px)`;