These are chat archives for pixijs/pixi.js

4th
Oct 2016
benny00100
@benny00100
Oct 04 2016 09:29

Hi there ... small question.

The following lines give me the error "Uncaught TypeError: Cannot read property 'clear' of null(…)"

var r = PIXI.autoDetectRenderer();
r.clear();

What am I doing wrong?

Ivan Popelyshev
@ivanpopelyshev
Oct 04 2016 10:44
it will work after first render() i guess
benny00100
@benny00100
Oct 04 2016 12:25

@ivanpopelyshev You are right.

var r = PIXI.autoDetectRenderer();
r.render(new PIXI.Container());
r.clear();

works - feels strange though. I am used to clear the canvas before I render something new to it.

Nevertheless, thanks for pointing this out.