There are two sprites, one is dynamic and second have to be constantly updated with first one through PIXI.RenderTexture()
let sprite = new PIXI.Sprite(), tmp = new PIXI.Sprite();
//some manimulations with these sprites
app.ticker.add((delta_) => {
...
updateTexture(w, h); //width is dynamic value
...
})
Here is updateTexture() function
function updateTexture(w_, h_){
let renderTexture = PIXI.RenderTexture.create({ width: w_, height: h_});
tmp.texture = sprite.texture;
app.renderer.render(tmp, renderTexture);
app.renderer.clear();
placeholder_.texture = renderTexture;
placeholder_.texture.update();
}
And it seems that let renderTexture = PIXI.RenderTexture.create({ width: w_, height: h_}); creates a new instance in memory dumping it every time up to browser crash.
app.renderer.clear() doesn't helps.
Any ideas?