mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
Added SpriteSheet support to chuck animations
This commit is contained in:
parent
c6add97a38
commit
dbde25f76e
259 changed files with 2533 additions and 5 deletions
|
|
@ -48,7 +48,10 @@ function (Parent, PIXI, ColorRangeReplaceFilter, Settings) {
|
|||
|
||||
Layer.prototype.createMesh = function (texturePath, callback, options) {
|
||||
|
||||
var texture = PIXI.Texture.fromImage(texturePath);
|
||||
var texture = (options && options.fromFrame)
|
||||
? PIXI.Texture.fromFrame(texturePath)
|
||||
: PIXI.Texture.fromImage(texturePath);
|
||||
|
||||
|
||||
var mesh = new PIXI.Sprite(texture);
|
||||
|
||||
|
|
@ -60,7 +63,11 @@ function (Parent, PIXI, ColorRangeReplaceFilter, Settings) {
|
|||
Layer.prototype.createAnimatedMesh = function (texturePaths, callback, options) {
|
||||
var textures = [];
|
||||
for (var i = 0; i < texturePaths.length; i++) {
|
||||
var texture = PIXI.Texture.fromImage(texturePaths[i]);
|
||||
|
||||
var texture = (options && options.fromFrame)
|
||||
? PIXI.Texture.fromFrame(texturePaths[i])
|
||||
: PIXI.Texture.fromImage(texturePaths[i]);
|
||||
|
||||
texture.width = options.width;
|
||||
texture.height = options.height;
|
||||
//PIXI.texturesToUpdate.push(texture);
|
||||
|
|
|
|||
|
|
@ -166,6 +166,17 @@ function (Parent, DomController, PIXI, Settings, Nc, Exception, GameStats, Layer
|
|||
this.currentZoom = Settings.ZOOM_DEFAULT;
|
||||
};
|
||||
|
||||
PixiView.prototype.getTexturesFromFrame = function(textureNames) {
|
||||
|
||||
var textures = [];
|
||||
|
||||
for (var i = 0; i < textureNames.length; i++) {
|
||||
textures.push(PIXI.Texture.fromFrame(textureNames[i]));
|
||||
};
|
||||
|
||||
return textures;
|
||||
};
|
||||
|
||||
PixiView.prototype.destroy = function() {
|
||||
|
||||
this.layerManager.destroy(); // also calls all layers destroy
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue