refactor: better render defaults

This commit is contained in:
cha0s 2019-03-25 23:39:07 -05:00
parent 26fa5e4589
commit af143670cc

View File

@ -2,7 +2,7 @@ const PIXI = 'undefined' !== typeof window ? require('pixi.js') : undefined;
export class Renderer {
constructor(size, type = 'auto') {
constructor(size = [0, 0], type = 'auto') {
switch (type) {
case 'auto':
this.renderer = PIXI.autoDetectRenderer(size[0], size[1]);
@ -11,7 +11,7 @@ export class Renderer {
this.renderer = new PIXI.CanvasRenderer(size[0], size[1]);
break;
case 'webgl':
this.renderer = new PIXI.Renderer(size[0], size[1]);
this.renderer = new PIXI.WebGLRenderer(size[0], size[1]);
break;
}
}