mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-12 19:17:35 +00:00
updated pixi to v2
This commit is contained in:
parent
a5b3d2f671
commit
58b83f7297
95 changed files with 44677 additions and 3522 deletions
81
app/Lib/Vendor/src/pixi/loaders/SpineLoader.js
vendored
Normal file
81
app/Lib/Vendor/src/pixi/loaders/SpineLoader.js
vendored
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
/**
|
||||
* @author Mat Groves http://matgroves.com/ @Doormat23
|
||||
* based on pixi impact spine implementation made by Eemeli Kelokorpi (@ekelokorpi) https://github.com/ekelokorpi
|
||||
*
|
||||
* Awesome JS run time provided by EsotericSoftware
|
||||
* https://github.com/EsotericSoftware/spine-runtimes
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* The Spine loader is used to load in JSON spine data
|
||||
* To generate the data you need to use http://esotericsoftware.com/ and export in the "JSON" format
|
||||
* Due to a clash of names You will need to change the extension of the spine file from *.json to *.anim for it to load
|
||||
* See example 12 (http://www.goodboydigital.com/pixijs/examples/12/) to see a working example and check out the source
|
||||
* You will need to generate a sprite sheet to accompany the spine data
|
||||
* When loaded this class will dispatch a "loaded" event
|
||||
*
|
||||
* @class SpineLoader
|
||||
* @uses EventTarget
|
||||
* @constructor
|
||||
* @param url {String} The url of the JSON file
|
||||
* @param crossorigin {Boolean} Whether requests should be treated as crossorigin
|
||||
*/
|
||||
PIXI.SpineLoader = function(url, crossorigin)
|
||||
{
|
||||
/**
|
||||
* The url of the bitmap font data
|
||||
*
|
||||
* @property url
|
||||
* @type String
|
||||
*/
|
||||
this.url = url;
|
||||
|
||||
/**
|
||||
* Whether the requests should be treated as cross origin
|
||||
*
|
||||
* @property crossorigin
|
||||
* @type Boolean
|
||||
*/
|
||||
this.crossorigin = crossorigin;
|
||||
|
||||
/**
|
||||
* [read-only] Whether the data has loaded yet
|
||||
*
|
||||
* @property loaded
|
||||
* @type Boolean
|
||||
* @readOnly
|
||||
*/
|
||||
this.loaded = false;
|
||||
};
|
||||
|
||||
PIXI.SpineLoader.prototype.constructor = PIXI.SpineLoader;
|
||||
|
||||
PIXI.EventTarget.mixin(PIXI.SpineLoader.prototype);
|
||||
|
||||
/**
|
||||
* Loads the JSON data
|
||||
*
|
||||
* @method load
|
||||
*/
|
||||
PIXI.SpineLoader.prototype.load = function () {
|
||||
|
||||
var scope = this;
|
||||
var jsonLoader = new PIXI.JsonLoader(this.url, this.crossorigin);
|
||||
jsonLoader.on('loaded', function (event) {
|
||||
scope.json = event.data.content.json;
|
||||
scope.onLoaded();
|
||||
});
|
||||
jsonLoader.load();
|
||||
};
|
||||
|
||||
/**
|
||||
* Invoked when JSON file is loaded.
|
||||
*
|
||||
* @method onLoaded
|
||||
* @private
|
||||
*/
|
||||
PIXI.SpineLoader.prototype.onLoaded = function () {
|
||||
this.loaded = true;
|
||||
this.emit('loaded', { content: this });
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue