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
|
|
@ -107,6 +107,9 @@ function (Parent, Settings, Nc, Exception, ColorConverter, Layer) {
|
|||
|
||||
var texturePaths = [];
|
||||
for (var i = start; i <= end; i++) {
|
||||
|
||||
/*
|
||||
// Multiple File Animations
|
||||
texturePaths.push(
|
||||
Settings.GRAPHICS_PATH
|
||||
+ Settings.GRAPHICS_SUBPATH_CHARACTERS
|
||||
|
|
@ -115,8 +118,15 @@ function (Parent, Settings, Nc, Exception, ColorConverter, Layer) {
|
|||
+ padF(i)
|
||||
+ ".png"
|
||||
);
|
||||
*/
|
||||
|
||||
// Single File Animations (animation names from chuck_sheet.json, use option fromFrame=true)
|
||||
texturePaths.push(
|
||||
"Chuck" + arm.toUpperCaseFirstChar() + "0" + padF(i) + ".png"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
var callback = function(mesh) {
|
||||
self.animatedMeshesContainer[arm][key] = mesh;
|
||||
Nc.trigger(Nc.ns.client.view.mesh.add, self.layerId, mesh);
|
||||
|
|
@ -130,12 +140,13 @@ function (Parent, Settings, Nc, Exception, ColorConverter, Layer) {
|
|||
x: 0,
|
||||
y: 40 * 4
|
||||
},
|
||||
width: 35,
|
||||
height: 40,
|
||||
xScale: 0.25,
|
||||
yScale: 0.25,
|
||||
anchor: {
|
||||
x: 0.5,
|
||||
y: 0
|
||||
}
|
||||
},
|
||||
fromFrame: true
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue