refactor: better render defaults
This commit is contained in:
parent
26fa5e4589
commit
af143670cc
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user