Hello, in my game you drawing many time in using this script:
For delete them I use:
But it's not convenient for me because it's only destroy them from the first to the last.
For know I'm trying to use the script below to delete them in the reverse order.
But each time I have i = 0, I have a black screen because all my scene is destroy.
How I do for it destroy only my children 'line' from the last to the first?
JavaScript:
const s = SceneManager._scene._spriteset;
line = new PIXI.Graphics();
line.name = 'line'; s.addChild(line);
line.lineStyle(1,0x0000ff);
line.moveTo(100,100);
line.lineTo(200,200);
For delete them I use:
JavaScript:
SceneManager._scene._spriteset.getChildByName('line').destroy()
But it's not convenient for me because it's only destroy them from the first to the last.
For know I'm trying to use the script below to delete them in the reverse order.
JavaScript:
const s = SceneManager._scene._spriteset;
const line = s.children
for (let i = line.length - 1; i >= 0; i--)
SceneManager._scene._spriteset.getChildAt(i - 0).destroy()
But each time I have i = 0, I have a black screen because all my scene is destroy.
How I do for it destroy only my children 'line' from the last to the first?