mirror of
https://github.com/photonstorm/phaser
synced 2024-11-22 12:43:26 +00:00
The Spine Plugin will now work in HEADLESS mode without crashing. Fix #4988
This commit is contained in:
parent
d38cae6682
commit
b1929b8579
1 changed files with 14 additions and 0 deletions
|
@ -12,6 +12,7 @@ var ScenePlugin = require('../../../src/plugins/ScenePlugin');
|
||||||
var Spine = require('Spine');
|
var Spine = require('Spine');
|
||||||
var SpineFile = require('./SpineFile');
|
var SpineFile = require('./SpineFile');
|
||||||
var SpineGameObject = require('./gameobject/SpineGameObject');
|
var SpineGameObject = require('./gameobject/SpineGameObject');
|
||||||
|
var NOOP = require('../../../src/utils/NOOP');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @classdesc
|
* @classdesc
|
||||||
|
@ -278,6 +279,19 @@ var SpinePlugin = new Class({
|
||||||
this.getAtlas = this.getAtlasCanvas;
|
this.getAtlas = this.getAtlasCanvas;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Headless mode?
|
||||||
|
if (!this.renderer)
|
||||||
|
{
|
||||||
|
this.renderer = {
|
||||||
|
width: game.scale.width,
|
||||||
|
height: game.scale.height,
|
||||||
|
preRender: NOOP,
|
||||||
|
postRender: NOOP,
|
||||||
|
render: NOOP,
|
||||||
|
destroy: NOOP
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
var _this = this;
|
var _this = this;
|
||||||
|
|
||||||
var add = function (x, y, key, animationName, loop)
|
var add = function (x, y, key, animationName, loop)
|
||||||
|
|
Loading…
Reference in a new issue