Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pixi-spine

Package Overview
Dependencies
Maintainers
2
Versions
110
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pixi-spine - npm Package Compare versions

Comparing version 1.0.21 to 1.0.22

2

package.json
{
"name": "pixi-spine",
"version": "1.0.21",
"version": "1.0.22",
"description": "Spine implementation for pixi v^3",

@@ -5,0 +5,0 @@ "author": "Mat Groves",

@@ -84,18 +84,25 @@ # pixi-spine

### How to use pixi spritesheet with it
It's possible to load each image separately as opposed to loading in just one spritesheet. This can be useful if SVGs are needed instead of providing many PNG files. Simply create an Atlas object and pass in an object of image names and PIXI textures, like so:
```js
var spine = PIXI.spine;
var loader = new PIXI.loaders.Loader();
loader.add('spritesheet', 'myspritesheet.json', function(res1) {
var atlas = new spine.Atlas();
atlas.addTextureHash(res1.textures, true);
//second parameter is stripExtension=true because we dont need '.png' inside region names
//res1 is the same as loader.resources['spritesheet']
loader.add('spineboy', 'spineboy.json', { metadata: { spineAtlas: atlas } },
function(res2) {
var mySpineBoy = new spine.Spine(res2.spineData);
stage.addChild(mySpineBoy);
});
})
var atlas = new spine.SpineRuntime.Atlas();
/**
* Example below shows the textures hardcoded below, but it's also possible to load in a JSON
* file with these values using:
* loader.add('spritesheet', 'myspritesheet.json', callback);
*/
var allTextures = {
'head': PIXI.Texture.fromImage('head.svg'),
'left-eye': PIXI.Texture.fromImage('left-eye.svg')
};
//second parameter is stripExtension=true because we dont need '.png' inside region names
atlas.addTextureHash(allTextures, true);
PIXI.loader
.add('spineboy', 'spineboy.json', {metadata: {spineAtlas: atlas}})
.load(function(response) {
var mySpineBoy = new PIXI.spine.Spine(response.resources.boy.spineData);
stage.addChild(mySpineBoy);
});
```

@@ -108,6 +115,6 @@

if (spineBoy.state.hasAnimationByName('run')) {
//run forever, little boy!
spineBoy.state.setAnimationByName(0, 'run', true);
//dont run too fast
spineBoy.state.timeScale = 0.1;
//run forever, little boy!
spineBoy.state.setAnimationByName(0, 'run', true);
//dont run too fast
spineBoy.state.timeScale = 0.1;
}

@@ -114,0 +121,0 @@ ```

@@ -210,11 +210,22 @@ var spine = require('../SpineRuntime');

if (slotContainer.transform ) {
var transform = slotContainer.transform;
//PIXI v4.1
var lt;
if (slotContainer.transform.matrix2d) {
lt = transform.matrix2d;
transform._dirtyVersion++;
transform.version = transform._dirtyVersion;
transform.isStatic = true;
transform.operMode = 0;
} else {
//PIXI v4.0
if (!slotContainer.transform._dirtyLocal) {
slotContainer.transform = new PIXI.TransformStatic();
if (!transform._dirtyLocal) {
transform = new PIXI.TransformStatic();
slotContainer.transform = transform;
}
lt = transform.localTransform;
transform._dirtyParentVersion = -1;
transform._dirtyLocal = 1;
transform._versionLocal = 1;
}
var transform = slotContainer.transform;
var lt = transform.localTransform;
transform._dirtyParentVersion = -1;
transform._dirtyLocal = 1;
transform._versionLocal = 1;
slot.bone.matrix.copy(lt);

@@ -234,3 +245,3 @@ lt.tx += slot.bone.skeleton.x;

slot.currentSprite.blendMode = slot.blendMode;
slot.currentSprite.tint = PIXI.utils.rgb2hex([slot.r,slot.g,slot.b]);
slot.currentSprite.tint = PIXI.utils.rgb2hex([slot.r * attachment.r, slot.g * attachment.g, slot.b * attachment.b]);
}

@@ -237,0 +248,0 @@ else if (type === spine.AttachmentType.skinnedmesh || type === spine.AttachmentType.mesh)

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc