diff --git a/.gitignore b/.gitignore index 7f057613d..4756dabad 100644 --- a/.gitignore +++ b/.gitignore @@ -31,8 +31,6 @@ spine-xna/obj spine-xna/example/bin spine-xna/example/obj -spine-unity/Assets/Plugins/Spine/spine-csharp/* -!spine-unity/Assets/Plugins/Spine/spine-csharp/Place spine-csharp here.txt spine-unity/ProjectSettings spine-unity/Temp spine-unity/Library @@ -41,6 +39,8 @@ spine-unity/*.sln *.pidb Assembly-*.csproj Assembly-*.pidb +spine-unity4 +spine-unity3 spine-corona/spine-lua/ !spine-corona/spine-lua/Place spine-lua here.txt @@ -48,3 +48,5 @@ spine-corona/spine-lua/ spine-love/spine-lua/ spine-love/love/ !spine-love/spine-lua/Place spine-lua here.txt + +spine-starling diff --git a/spine-c/include/spine/RegionAttachment.h b/spine-c/include/spine/RegionAttachment.h index 1046ba3f5..e37c5a537 100644 --- a/spine-c/include/spine/RegionAttachment.h +++ b/spine-c/include/spine/RegionAttachment.h @@ -43,14 +43,19 @@ typedef struct RegionAttachment RegionAttachment; struct RegionAttachment { Attachment super; float x, y, scaleX, scaleY, rotation, width, height; - AtlasRegion* region; + + void* texture; + float regionOffsetX, regionOffsetY; // Pixels stripped from the bottom left, unrotated. + float regionWidth, regionHeight; // Unrotated, stripped size. + float regionOriginalWidth, regionOriginalHeight; // Unrotated, unstripped size. + float offset[8]; float vertices[8]; float uvs[8]; }; RegionAttachment* RegionAttachment_create (const char* name); - +void RegionAttachment_setUVs (RegionAttachment* self, float u, float v, float u2, float v2, int/*bool*/rotate); void RegionAttachment_updateOffset (RegionAttachment* self); void RegionAttachment_updateVertices (RegionAttachment* self, Slot* slot); diff --git a/spine-c/src/spine/Animation.c b/spine-c/src/spine/Animation.c index 811348eb3..98d352897 100644 --- a/spine-c/src/spine/Animation.c +++ b/spine-c/src/spine/Animation.c @@ -44,6 +44,7 @@ void Animation_dispose (Animation* self) { for (i = 0; i < self->timelineCount; ++i) Timeline_dispose(self->timelines[i]); FREE(self->timelines); + FREE(self->name); FREE(self); } diff --git a/spine-c/src/spine/Atlas.c b/spine-c/src/spine/Atlas.c index f84db4dfd..34677ab33 100644 --- a/spine-c/src/spine/Atlas.c +++ b/spine-c/src/spine/Atlas.c @@ -240,8 +240,13 @@ Atlas* Atlas_readAtlas (const char* begin, int length, const char* dir) { region->u = region->x / (float)page->width; region->v = region->y / (float)page->height; - region->u2 = (region->x + region->width) / (float)page->width; - region->v2 = (region->y + region->height) / (float)page->height; + if (region->rotate) { + region->u2 = (region->x + region->height) / (float)page->width; + region->v2 = (region->y + region->width) / (float)page->height; + } else { + region->u2 = (region->x + region->width) / (float)page->width; + region->v2 = (region->y + region->height) / (float)page->height; + } if (!(count = readTuple(end, tuple))) return abortAtlas(self); if (count == 4) { /* split is optional */ diff --git a/spine-c/src/spine/AtlasAttachmentLoader.c b/spine-c/src/spine/AtlasAttachmentLoader.c index 73abb97b2..f15753a86 100644 --- a/spine-c/src/spine/AtlasAttachmentLoader.c +++ b/spine-c/src/spine/AtlasAttachmentLoader.c @@ -31,18 +31,24 @@ namespace spine { #endif Attachment* _AtlasAttachmentLoader_newAttachment (AttachmentLoader* loader, Skin* skin, AttachmentType type, const char* name) { - RegionAttachment* attachment; - AtlasRegion* region; AtlasAttachmentLoader* self = SUB_CAST(AtlasAttachmentLoader, loader); switch (type) { case ATTACHMENT_REGION: { - region = Atlas_findRegion(self->atlas, name); + RegionAttachment* attachment; + AtlasRegion* region = Atlas_findRegion(self->atlas, name); if (!region) { _AttachmentLoader_setError(loader, "Region not found: ", name); return 0; } attachment = RegionAttachment_create(name); - attachment->region = region; + attachment->texture = region->page->texture; + RegionAttachment_setUVs(attachment, region->u, region->v, region->u2, region->v2, region->rotate); + attachment->regionOffsetX = region->offsetX; + attachment->regionOffsetY = region->offsetY; + attachment->regionWidth = region->width; + attachment->regionHeight = region->height; + attachment->regionOriginalWidth = region->originalWidth; + attachment->regionOriginalHeight = region->originalHeight; return SUPER(attachment); } default: @@ -60,4 +66,4 @@ AtlasAttachmentLoader* AtlasAttachmentLoader_create (Atlas* atlas) { #ifdef __cplusplus } -#endif +#endif \ No newline at end of file diff --git a/spine-c/src/spine/RegionAttachment.c b/spine-c/src/spine/RegionAttachment.c index 15ea12d49..869d94c22 100644 --- a/spine-c/src/spine/RegionAttachment.c +++ b/spine-c/src/spine/RegionAttachment.c @@ -39,49 +39,46 @@ RegionAttachment* RegionAttachment_create (const char* name) { return self; } -void RegionAttachment_updateOffset (RegionAttachment* self) { - float radians; - float cosine; - float sine; - float localXCos; - float localXSin; - float localYCos; - float localYSin; - float localX2Cos; - float localX2Sin; - float localY2Cos; - float localY2Sin; - - float localX2 = self->width / 2; - float localY2 = self->height / 2; - float localX = -localX2; - float localY = -localY2; - if (self->region->rotate) { - localX += self->region->offsetX / self->region->originalWidth * self->height; - localY += self->region->offsetY / self->region->originalHeight * self->width; - localX2 -= (self->region->originalWidth - self->region->offsetX - self->region->height) / self->region->originalWidth * self->width; - localY2 -= (self->region->originalHeight - self->region->offsetY - self->region->width) / self->region->originalHeight * self->height; +void RegionAttachment_setUVs (RegionAttachment* self, float u, float v, float u2, float v2, int/*bool*/rotate) { + if (rotate) { + self->uvs[VERTEX_X2] = u; + self->uvs[VERTEX_Y2] = v2; + self->uvs[VERTEX_X3] = u; + self->uvs[VERTEX_Y3] = v; + self->uvs[VERTEX_X4] = u2; + self->uvs[VERTEX_Y4] = v; + self->uvs[VERTEX_X1] = u2; + self->uvs[VERTEX_Y1] = v2; } else { - localX += self->region->offsetX / self->region->originalWidth * self->width; - localY += self->region->offsetY / self->region->originalHeight * self->height; - localX2 -= (self->region->originalWidth - self->region->offsetX - self->region->width) / self->region->originalWidth * self->width; - localY2 -= (self->region->originalHeight - self->region->offsetY - self->region->height) / self->region->originalHeight * self->height; + self->uvs[VERTEX_X1] = u; + self->uvs[VERTEX_Y1] = v2; + self->uvs[VERTEX_X2] = u; + self->uvs[VERTEX_Y2] = v; + self->uvs[VERTEX_X3] = u2; + self->uvs[VERTEX_Y3] = v; + self->uvs[VERTEX_X4] = u2; + self->uvs[VERTEX_Y4] = v2; } - localX *= self->scaleX; - localY *= self->scaleY; - localX2 *= self->scaleX; - localY2 *= self->scaleY; - radians = (float)(self->rotation * 3.1415926535897932385 / 180); - cosine = cosf(radians); - sine = sinf(radians); - localXCos = localX * cosine + self->x; - localXSin = localX * sine; - localYCos = localY * cosine + self->y; - localYSin = localY * sine; - localX2Cos = localX2 * cosine + self->x; - localX2Sin = localX2 * sine; - localY2Cos = localY2 * cosine + self->y; - localY2Sin = localY2 * sine; +} + +void RegionAttachment_updateOffset (RegionAttachment* self) { + float regionScaleX = self->width / self->regionOriginalWidth * self->scaleX; + float regionScaleY = self->height / self->regionOriginalHeight * self->scaleX; + float localX = -self->width / 2 * self->scaleX + self->regionOffsetX * regionScaleX; + float localY = -self->height / 2 * self->scaleX + self->regionOffsetY * regionScaleY; + float localX2 = localX + self->regionWidth * regionScaleX; + float localY2 = localY + self->regionHeight * regionScaleY; + float radians = (float)(self->rotation * 3.1415926535897932385 / 180); + float cosine = cosf(radians); + float sine = sinf(radians); + float localXCos = localX * cosine + self->x; + float localXSin = localX * sine; + float localYCos = localY * cosine + self->y; + float localYSin = localY * sine; + float localX2Cos = localX2 * cosine + self->x; + float localX2Sin = localX2 * sine; + float localY2Cos = localY2 * cosine + self->y; + float localY2Sin = localY2 * sine; self->offset[VERTEX_X1] = localXCos - localYSin; self->offset[VERTEX_Y1] = localYCos + localXSin; self->offset[VERTEX_X2] = localXCos - localY2Sin; @@ -107,4 +104,4 @@ void RegionAttachment_updateVertices (RegionAttachment* self, Slot* slot) { #ifdef __cplusplus } -#endif +#endif \ No newline at end of file diff --git a/spine-cocos2d-iphone/src/spine/spine-cocos2d-iphone.m b/spine-cocos2d-iphone/src/spine/spine-cocos2d-iphone.m index f301b8cb3..a5434568a 100644 --- a/spine-cocos2d-iphone/src/spine/spine-cocos2d-iphone.m +++ b/spine-cocos2d-iphone/src/spine/spine-cocos2d-iphone.m @@ -83,25 +83,14 @@ void RegionAttachment_updateQuad (RegionAttachment* self, Slot* slot, ccV3F_C4B_ quad->br.vertices.x = self->vertices[VERTEX_X4]; quad->br.vertices.y = self->vertices[VERTEX_Y4]; - if (self->region->rotate) { - quad->tl.texCoords.u = self->region->u; - quad->tl.texCoords.v = self->region->v2; - quad->tr.texCoords.u = self->region->u; - quad->tr.texCoords.v = self->region->v; - quad->br.texCoords.u = self->region->u2; - quad->br.texCoords.v = self->region->v; - quad->bl.texCoords.u = self->region->u2; - quad->bl.texCoords.v = self->region->v2; - } else { - quad->bl.texCoords.u = self->region->u; - quad->bl.texCoords.v = self->region->v2; - quad->tl.texCoords.u = self->region->u; - quad->tl.texCoords.v = self->region->v; - quad->tr.texCoords.u = self->region->u2; - quad->tr.texCoords.v = self->region->v; - quad->br.texCoords.u = self->region->u2; - quad->br.texCoords.v = self->region->v2; - } + quad->bl.texCoords.u = self->uvs[VERTEX_X1]; + quad->bl.texCoords.v = self->uvs[VERTEX_Y1]; + quad->tl.texCoords.u = self->uvs[VERTEX_X2]; + quad->tl.texCoords.v = self->uvs[VERTEX_Y2]; + quad->tr.texCoords.u = self->uvs[VERTEX_X3]; + quad->tr.texCoords.v = self->uvs[VERTEX_Y3]; + quad->br.texCoords.u = self->uvs[VERTEX_X4]; + quad->br.texCoords.v = self->uvs[VERTEX_Y4]; } #ifdef __cplusplus @@ -205,7 +194,7 @@ void RegionAttachment_updateQuad (RegionAttachment* self, Slot* slot, ccV3F_C4B_ } - (void) update:(ccTime)deltaTime { - Skeleton_update(skeleton, deltaTime); + Skeleton_update(skeleton, deltaTime * timeScale); AnimationState_update(state, deltaTime * timeScale); AnimationState_apply(state, skeleton); Skeleton_updateWorldTransform(skeleton); @@ -231,7 +220,7 @@ void RegionAttachment_updateQuad (RegionAttachment* self, Slot* slot, ccV3F_C4B_ Slot* slot = skeleton->slots[i]; if (!slot->attachment || slot->attachment->type != ATTACHMENT_REGION) continue; RegionAttachment* attachment = (RegionAttachment*)slot->attachment; - CCTextureAtlas* regionTextureAtlas = (CCTextureAtlas*)attachment->region->page->texture; + CCTextureAtlas* regionTextureAtlas = (CCTextureAtlas*)attachment->texture; if (regionTextureAtlas != textureAtlas) { if (textureAtlas) { [textureAtlas drawQuads]; diff --git a/spine-cocos2dx/example/Resources/common/goblins.json b/spine-cocos2dx/example/Resources/common/goblins.json index f1dcc96a0..95313ebe6 100644 --- a/spine-cocos2dx/example/Resources/common/goblins.json +++ b/spine-cocos2dx/example/Resources/common/goblins.json @@ -3,26 +3,26 @@ { "name": "root" }, { "name": "hip", "parent": "root", "x": 0.64, "y": 114.41 }, { "name": "left upper leg", "parent": "hip", "length": 50.39, "x": 14.45, "y": 2.81, "rotation": -89.09 }, - { "name": "left lower leg", "parent": "left upper leg", "length": 49.89, "x": 56.34, "y": 0.98, "rotation": -16.65 }, - { "name": "left foot", "parent": "left lower leg", "length": 46.5, "x": 58.94, "y": -7.61, "rotation": 102.43 }, + { "name": "pelvis", "parent": "hip", "x": 1.41, "y": -6.57 }, { "name": "right upper leg", "parent": "hip", "length": 42.45, "x": -20.07, "y": -6.83, "rotation": -97.49 }, - { "name": "right lower leg", "parent": "right upper leg", "length": 58.52, "x": 42.99, "y": -0.61, "rotation": -14.34 }, - { "name": "right foot", "parent": "right lower leg", "length": 45.45, "x": 64.88, "y": 0.04, "rotation": 110.3 }, { "name": "torso", "parent": "hip", "length": 85.82, "x": -6.42, "y": 1.97, "rotation": 93.92 }, - { "name": "neck", "parent": "torso", "length": 18.38, "x": 81.67, "y": -6.34, "rotation": -1.51 }, - { "name": "head", "parent": "neck", "length": 68.28, "x": 20.93, "y": 11.59, "rotation": -13.92 }, - { "name": "right shoulder", "parent": "torso", "length": 37.24, "x": 76.02, "y": 18.14, "rotation": 133.88 }, - { "name": "right arm", "parent": "right shoulder", "length": 36.74, "x": 37.6, "y": 0.31, "rotation": 36.32 }, - { "name": "right hand", "parent": "right arm", "length": 15.32, "x": 36.9, "y": 0.34, "rotation": 2.35 }, + { "name": "left lower leg", "parent": "left upper leg", "length": 49.89, "x": 56.34, "y": 0.98, "rotation": -16.65 }, { "name": "left shoulder", "parent": "torso", "length": 35.43, "x": 74.04, "y": -20.38, "rotation": -156.96 }, + { "name": "neck", "parent": "torso", "length": 18.38, "x": 81.67, "y": -6.34, "rotation": -1.51 }, + { "name": "right lower leg", "parent": "right upper leg", "length": 58.52, "x": 42.99, "y": -0.61, "rotation": -14.34 }, + { "name": "right shoulder", "parent": "torso", "length": 37.24, "x": 76.02, "y": 18.14, "rotation": 133.88 }, + { "name": "head", "parent": "neck", "length": 68.28, "x": 20.93, "y": 11.59, "rotation": -13.92 }, { "name": "left arm", "parent": "left shoulder", "length": 35.62, "x": 37.85, "y": -2.34, "rotation": 28.16 }, + { "name": "left foot", "parent": "left lower leg", "length": 46.5, "x": 58.94, "y": -7.61, "rotation": 102.43 }, + { "name": "right arm", "parent": "right shoulder", "length": 36.74, "x": 37.6, "y": 0.31, "rotation": 36.32 }, + { "name": "right foot", "parent": "right lower leg", "length": 45.45, "x": 64.88, "y": 0.04, "rotation": 110.3 }, { "name": "left hand", "parent": "left arm", "length": 11.52, "x": 35.62, "y": 0.07, "rotation": 2.7 }, - { "name": "pelvis", "parent": "hip", "x": 1.41, "y": -6.57 } + { "name": "right hand", "parent": "right arm", "length": 15.32, "x": 36.9, "y": 0.34, "rotation": 2.35 } ], "slots": [ { "name": "left shoulder", "bone": "left shoulder", "attachment": "left shoulder" }, { "name": "left arm", "bone": "left arm", "attachment": "left arm" }, - { "name": "left hand item", "bone": "left hand", "attachment": "spear" }, + { "name": "left hand item", "bone": "left hand", "attachment": "dagger" }, { "name": "left hand", "bone": "left hand", "attachment": "left hand" }, { "name": "left foot", "bone": "left foot", "attachment": "left foot" }, { "name": "left lower leg", "bone": "left lower leg", "attachment": "left lower leg" }, @@ -45,11 +45,11 @@ "skins": { "default": { "left hand item": { - "dagger": { "x": 7.88, "y": -23.45, "rotation": 10.47, "width": 26, "height": 108 }, + "dagger": { "x": -35.5, "y": 3.85, "rotation": 10.47, "width": 156, "height": 238 }, "spear": { "x": -4.55, "y": 39.2, "rotation": 13.04, "width": 22, "height": 368 } }, "right hand item": { - "dagger": { "x": 6.51, "y": -24.15, "rotation": -8.06, "width": 26, "height": 108 } + "dagger": { "x": -21.57, "y": 15.8, "rotation": -8.06, "width": 156, "height": 238 } } }, "goblin": { diff --git a/spine-cocos2dx/example/Resources/ipad/goblins.atlas b/spine-cocos2dx/example/Resources/ipad/goblins.atlas index 271742263..ce74602e5 100644 --- a/spine-cocos2dx/example/Resources/ipad/goblins.atlas +++ b/spine-cocos2dx/example/Resources/ipad/goblins.atlas @@ -4,282 +4,282 @@ format: RGBA8888 filter: Linear,Linear repeat: none spear - rotate: false - xy: 2, 142 + rotate: true + xy: 2, 104 size: 22, 368 orig: 22, 368 offset: 0, 0 index: -1 goblingirl/head rotate: false - xy: 26, 429 - size: 103, 81 + xy: 2, 23 + size: 103, 79 orig: 103, 81 - offset: 0, 0 + offset: 0, 2 index: -1 goblin/head rotate: false - xy: 26, 361 - size: 103, 66 + xy: 107, 38 + size: 103, 64 orig: 103, 66 offset: 0, 0 index: -1 goblin/torso - rotate: false - xy: 131, 414 + rotate: true + xy: 212, 34 size: 68, 96 orig: 68, 96 offset: 0, 0 index: -1 -goblingirl/torso +goblin/right-upper-leg + rotate: true + xy: 107, 2 + size: 34, 63 + orig: 34, 63 + offset: 0, 0 + index: -1 +goblin/left-lower-leg + rotate: true + xy: 172, 2 + size: 30, 70 + orig: 33, 70 + offset: 2, 0 + index: -1 +goblingirl/left-lower-leg + rotate: true + xy: 244, 2 + size: 30, 70 + orig: 33, 70 + offset: 2, 0 + index: -1 +goblin/undie-straps rotate: false - xy: 26, 263 - size: 68, 96 - orig: 68, 96 + xy: 2, 2 + size: 55, 19 + orig: 55, 19 offset: 0, 0 index: -1 dagger - rotate: false - xy: 26, 153 + rotate: true + xy: 372, 100 size: 26, 108 - orig: 26, 108 + orig: 156, 238 + offset: 100, 30 + index: -1 +goblingirl/torso + rotate: true + xy: 482, 60 + size: 66, 96 + orig: 68, 96 offset: 0, 0 index: -1 goblin/right-lower-leg - rotate: false - xy: 201, 434 - size: 36, 76 + rotate: true + xy: 580, 91 + size: 35, 76 orig: 36, 76 - offset: 0, 0 + offset: 1, 0 index: -1 goblingirl/right-lower-leg - rotate: false - xy: 54, 185 - size: 36, 76 + rotate: true + xy: 658, 91 + size: 35, 76 orig: 36, 76 - offset: 0, 0 + offset: 1, 0 index: -1 goblin/left-upper-leg - rotate: false - xy: 96, 286 + rotate: true + xy: 736, 93 size: 33, 73 orig: 33, 73 offset: 0, 0 index: -1 goblin/pelvis - rotate: false - xy: 131, 369 + rotate: true + xy: 310, 40 size: 62, 43 orig: 62, 43 offset: 0, 0 index: -1 -goblingirl/pelvis - rotate: false - xy: 131, 324 - size: 62, 43 - orig: 62, 43 - offset: 0, 0 - index: -1 -goblin/right-foot - rotate: false - xy: 131, 289 - size: 63, 33 - orig: 63, 33 - offset: 0, 0 - index: -1 -goblin/left-lower-leg - rotate: false - xy: 2, 70 - size: 33, 70 - orig: 33, 70 - offset: 0, 0 - index: -1 -goblin/right-upper-leg - rotate: false - xy: 2, 5 - size: 34, 63 - orig: 34, 63 - offset: 0, 0 - index: -1 -goblingirl/left-lower-leg - rotate: false - xy: 195, 342 - size: 33, 70 - orig: 33, 70 +goblin/left-hand + rotate: true + xy: 316, 2 + size: 36, 41 + orig: 36, 41 offset: 0, 0 index: -1 goblingirl/left-upper-leg - rotate: false - xy: 37, 81 + rotate: true + xy: 811, 93 size: 33, 70 orig: 33, 70 offset: 0, 0 index: -1 -goblingirl/right-upper-leg - rotate: false - xy: 38, 16 - size: 34, 63 - orig: 34, 63 - offset: 0, 0 - index: -1 -goblin/eyes-closed - rotate: false - xy: 38, 2 - size: 34, 12 - orig: 34, 12 - offset: 0, 0 - index: -1 -goblin/undies - rotate: false - xy: 54, 154 - size: 36, 29 - orig: 36, 29 - offset: 0, 0 - index: -1 -goblin/right-arm - rotate: false - xy: 72, 102 - size: 23, 50 - orig: 23, 50 - offset: 0, 0 - index: -1 goblin/left-foot rotate: false - xy: 131, 256 + xy: 883, 95 size: 65, 31 orig: 65, 31 offset: 0, 0 index: -1 -goblingirl/right-arm - rotate: false - xy: 196, 290 - size: 28, 50 - orig: 28, 50 - offset: 0, 0 - index: -1 -goblingirl/left-shoulder - rotate: false - xy: 226, 294 - size: 28, 46 - orig: 28, 46 - offset: 0, 0 - index: -1 -goblin/left-arm - rotate: false - xy: 198, 253 - size: 37, 35 - orig: 37, 35 - offset: 0, 0 - index: -1 goblingirl/left-foot rotate: false - xy: 92, 223 + xy: 950, 95 size: 65, 31 orig: 65, 31 offset: 0, 0 index: -1 -goblingirl/right-foot +goblin/right-foot rotate: false - xy: 92, 188 + xy: 580, 56 size: 63, 33 orig: 63, 33 offset: 0, 0 index: -1 -goblin/undie-straps +goblingirl/right-foot rotate: false - xy: 92, 167 - size: 55, 19 - orig: 55, 19 + xy: 645, 56 + size: 63, 33 + orig: 63, 33 offset: 0, 0 index: -1 -goblingirl/left-arm +goblingirl/pelvis rotate: false - xy: 159, 219 - size: 37, 35 - orig: 37, 35 + xy: 355, 55 + size: 59, 43 + orig: 62, 43 + offset: 1, 0 + index: -1 +goblingirl/right-upper-leg + rotate: true + xy: 416, 64 + size: 34, 63 + orig: 34, 63 offset: 0, 0 index: -1 goblin/right-shoulder rotate: false - xy: 97, 120 - size: 39, 45 + xy: 359, 11 + size: 39, 42 orig: 39, 45 offset: 0, 0 index: -1 -goblingirl/right-shoulder - rotate: false - xy: 198, 206 - size: 39, 45 - orig: 39, 45 - offset: 0, 0 - index: -1 -goblin/left-hand - rotate: false - xy: 157, 176 - size: 36, 41 - orig: 36, 41 - offset: 0, 0 - index: -1 -goblin/neck - rotate: false - xy: 195, 163 - size: 36, 41 - orig: 36, 41 - offset: 0, 0 - index: -1 goblingirl/undie-straps rotate: false - xy: 97, 99 + xy: 416, 43 size: 55, 19 orig: 55, 19 offset: 0, 0 index: -1 -goblingirl/neck +goblingirl/right-shoulder + rotate: true + xy: 400, 2 + size: 39, 42 + orig: 39, 45 + offset: 0, 0 + index: -1 +goblin/left-arm + rotate: true + xy: 444, 4 + size: 37, 35 + orig: 37, 35 + offset: 0, 0 + index: -1 +goblin/neck rotate: false - xy: 138, 120 - size: 35, 41 - orig: 35, 41 + xy: 481, 17 + size: 36, 41 + orig: 36, 41 offset: 0, 0 index: -1 goblingirl/left-hand rotate: false - xy: 175, 121 + xy: 519, 18 size: 35, 40 orig: 35, 40 offset: 0, 0 index: -1 -goblin/left-shoulder +goblingirl/right-arm rotate: false - xy: 212, 117 + xy: 556, 8 + size: 22, 50 + orig: 28, 50 + offset: 3, 0 + index: -1 +goblingirl/neck + rotate: false + xy: 580, 13 + size: 33, 41 + orig: 35, 41 + offset: 0, 0 + index: -1 +goblin/left-shoulder + rotate: true + xy: 615, 25 size: 29, 44 orig: 29, 44 offset: 0, 0 index: -1 -goblingirl/eyes-closed +goblingirl/left-shoulder + rotate: true + xy: 661, 26 + size: 28, 45 + orig: 28, 46 + offset: 0, 1 + index: -1 +goblingirl/left-arm rotate: false - xy: 154, 97 - size: 37, 21 - orig: 37, 21 + xy: 710, 54 + size: 37, 35 + orig: 37, 35 + offset: 0, 0 + index: -1 +goblin/right-arm + rotate: false + xy: 708, 2 + size: 23, 50 + orig: 23, 50 offset: 0, 0 index: -1 goblin/right-hand rotate: false - xy: 193, 78 + xy: 749, 54 size: 36, 37 orig: 36, 37 offset: 0, 0 index: -1 goblingirl/right-hand rotate: false - xy: 74, 39 - size: 36, 37 + xy: 733, 15 + size: 35, 37 orig: 36, 37 - offset: 0, 0 + offset: 1, 0 index: -1 -goblingirl/undies +goblin/undies rotate: false - xy: 74, 8 + xy: 787, 62 size: 36, 29 orig: 36, 29 offset: 0, 0 index: -1 +goblingirl/undies + rotate: false + xy: 825, 62 + size: 36, 29 + orig: 36, 29 + offset: 0, 0 + index: -1 +goblingirl/eyes-closed + rotate: false + xy: 59, 6 + size: 37, 15 + orig: 37, 21 + offset: 0, 0 + index: -1 +goblin/eyes-closed + rotate: true + xy: 770, 18 + size: 34, 12 + orig: 34, 12 + offset: 0, 0 + index: -1 diff --git a/spine-cocos2dx/example/Resources/ipad/goblins.png b/spine-cocos2dx/example/Resources/ipad/goblins.png index 863b29467..1d6f59e37 100644 Binary files a/spine-cocos2dx/example/Resources/ipad/goblins.png and b/spine-cocos2dx/example/Resources/ipad/goblins.png differ diff --git a/spine-cocos2dx/example/Resources/ipadhd/goblins.atlas b/spine-cocos2dx/example/Resources/ipadhd/goblins.atlas index 271742263..ce74602e5 100644 --- a/spine-cocos2dx/example/Resources/ipadhd/goblins.atlas +++ b/spine-cocos2dx/example/Resources/ipadhd/goblins.atlas @@ -4,282 +4,282 @@ format: RGBA8888 filter: Linear,Linear repeat: none spear - rotate: false - xy: 2, 142 + rotate: true + xy: 2, 104 size: 22, 368 orig: 22, 368 offset: 0, 0 index: -1 goblingirl/head rotate: false - xy: 26, 429 - size: 103, 81 + xy: 2, 23 + size: 103, 79 orig: 103, 81 - offset: 0, 0 + offset: 0, 2 index: -1 goblin/head rotate: false - xy: 26, 361 - size: 103, 66 + xy: 107, 38 + size: 103, 64 orig: 103, 66 offset: 0, 0 index: -1 goblin/torso - rotate: false - xy: 131, 414 + rotate: true + xy: 212, 34 size: 68, 96 orig: 68, 96 offset: 0, 0 index: -1 -goblingirl/torso +goblin/right-upper-leg + rotate: true + xy: 107, 2 + size: 34, 63 + orig: 34, 63 + offset: 0, 0 + index: -1 +goblin/left-lower-leg + rotate: true + xy: 172, 2 + size: 30, 70 + orig: 33, 70 + offset: 2, 0 + index: -1 +goblingirl/left-lower-leg + rotate: true + xy: 244, 2 + size: 30, 70 + orig: 33, 70 + offset: 2, 0 + index: -1 +goblin/undie-straps rotate: false - xy: 26, 263 - size: 68, 96 - orig: 68, 96 + xy: 2, 2 + size: 55, 19 + orig: 55, 19 offset: 0, 0 index: -1 dagger - rotate: false - xy: 26, 153 + rotate: true + xy: 372, 100 size: 26, 108 - orig: 26, 108 + orig: 156, 238 + offset: 100, 30 + index: -1 +goblingirl/torso + rotate: true + xy: 482, 60 + size: 66, 96 + orig: 68, 96 offset: 0, 0 index: -1 goblin/right-lower-leg - rotate: false - xy: 201, 434 - size: 36, 76 + rotate: true + xy: 580, 91 + size: 35, 76 orig: 36, 76 - offset: 0, 0 + offset: 1, 0 index: -1 goblingirl/right-lower-leg - rotate: false - xy: 54, 185 - size: 36, 76 + rotate: true + xy: 658, 91 + size: 35, 76 orig: 36, 76 - offset: 0, 0 + offset: 1, 0 index: -1 goblin/left-upper-leg - rotate: false - xy: 96, 286 + rotate: true + xy: 736, 93 size: 33, 73 orig: 33, 73 offset: 0, 0 index: -1 goblin/pelvis - rotate: false - xy: 131, 369 + rotate: true + xy: 310, 40 size: 62, 43 orig: 62, 43 offset: 0, 0 index: -1 -goblingirl/pelvis - rotate: false - xy: 131, 324 - size: 62, 43 - orig: 62, 43 - offset: 0, 0 - index: -1 -goblin/right-foot - rotate: false - xy: 131, 289 - size: 63, 33 - orig: 63, 33 - offset: 0, 0 - index: -1 -goblin/left-lower-leg - rotate: false - xy: 2, 70 - size: 33, 70 - orig: 33, 70 - offset: 0, 0 - index: -1 -goblin/right-upper-leg - rotate: false - xy: 2, 5 - size: 34, 63 - orig: 34, 63 - offset: 0, 0 - index: -1 -goblingirl/left-lower-leg - rotate: false - xy: 195, 342 - size: 33, 70 - orig: 33, 70 +goblin/left-hand + rotate: true + xy: 316, 2 + size: 36, 41 + orig: 36, 41 offset: 0, 0 index: -1 goblingirl/left-upper-leg - rotate: false - xy: 37, 81 + rotate: true + xy: 811, 93 size: 33, 70 orig: 33, 70 offset: 0, 0 index: -1 -goblingirl/right-upper-leg - rotate: false - xy: 38, 16 - size: 34, 63 - orig: 34, 63 - offset: 0, 0 - index: -1 -goblin/eyes-closed - rotate: false - xy: 38, 2 - size: 34, 12 - orig: 34, 12 - offset: 0, 0 - index: -1 -goblin/undies - rotate: false - xy: 54, 154 - size: 36, 29 - orig: 36, 29 - offset: 0, 0 - index: -1 -goblin/right-arm - rotate: false - xy: 72, 102 - size: 23, 50 - orig: 23, 50 - offset: 0, 0 - index: -1 goblin/left-foot rotate: false - xy: 131, 256 + xy: 883, 95 size: 65, 31 orig: 65, 31 offset: 0, 0 index: -1 -goblingirl/right-arm - rotate: false - xy: 196, 290 - size: 28, 50 - orig: 28, 50 - offset: 0, 0 - index: -1 -goblingirl/left-shoulder - rotate: false - xy: 226, 294 - size: 28, 46 - orig: 28, 46 - offset: 0, 0 - index: -1 -goblin/left-arm - rotate: false - xy: 198, 253 - size: 37, 35 - orig: 37, 35 - offset: 0, 0 - index: -1 goblingirl/left-foot rotate: false - xy: 92, 223 + xy: 950, 95 size: 65, 31 orig: 65, 31 offset: 0, 0 index: -1 -goblingirl/right-foot +goblin/right-foot rotate: false - xy: 92, 188 + xy: 580, 56 size: 63, 33 orig: 63, 33 offset: 0, 0 index: -1 -goblin/undie-straps +goblingirl/right-foot rotate: false - xy: 92, 167 - size: 55, 19 - orig: 55, 19 + xy: 645, 56 + size: 63, 33 + orig: 63, 33 offset: 0, 0 index: -1 -goblingirl/left-arm +goblingirl/pelvis rotate: false - xy: 159, 219 - size: 37, 35 - orig: 37, 35 + xy: 355, 55 + size: 59, 43 + orig: 62, 43 + offset: 1, 0 + index: -1 +goblingirl/right-upper-leg + rotate: true + xy: 416, 64 + size: 34, 63 + orig: 34, 63 offset: 0, 0 index: -1 goblin/right-shoulder rotate: false - xy: 97, 120 - size: 39, 45 + xy: 359, 11 + size: 39, 42 orig: 39, 45 offset: 0, 0 index: -1 -goblingirl/right-shoulder - rotate: false - xy: 198, 206 - size: 39, 45 - orig: 39, 45 - offset: 0, 0 - index: -1 -goblin/left-hand - rotate: false - xy: 157, 176 - size: 36, 41 - orig: 36, 41 - offset: 0, 0 - index: -1 -goblin/neck - rotate: false - xy: 195, 163 - size: 36, 41 - orig: 36, 41 - offset: 0, 0 - index: -1 goblingirl/undie-straps rotate: false - xy: 97, 99 + xy: 416, 43 size: 55, 19 orig: 55, 19 offset: 0, 0 index: -1 -goblingirl/neck +goblingirl/right-shoulder + rotate: true + xy: 400, 2 + size: 39, 42 + orig: 39, 45 + offset: 0, 0 + index: -1 +goblin/left-arm + rotate: true + xy: 444, 4 + size: 37, 35 + orig: 37, 35 + offset: 0, 0 + index: -1 +goblin/neck rotate: false - xy: 138, 120 - size: 35, 41 - orig: 35, 41 + xy: 481, 17 + size: 36, 41 + orig: 36, 41 offset: 0, 0 index: -1 goblingirl/left-hand rotate: false - xy: 175, 121 + xy: 519, 18 size: 35, 40 orig: 35, 40 offset: 0, 0 index: -1 -goblin/left-shoulder +goblingirl/right-arm rotate: false - xy: 212, 117 + xy: 556, 8 + size: 22, 50 + orig: 28, 50 + offset: 3, 0 + index: -1 +goblingirl/neck + rotate: false + xy: 580, 13 + size: 33, 41 + orig: 35, 41 + offset: 0, 0 + index: -1 +goblin/left-shoulder + rotate: true + xy: 615, 25 size: 29, 44 orig: 29, 44 offset: 0, 0 index: -1 -goblingirl/eyes-closed +goblingirl/left-shoulder + rotate: true + xy: 661, 26 + size: 28, 45 + orig: 28, 46 + offset: 0, 1 + index: -1 +goblingirl/left-arm rotate: false - xy: 154, 97 - size: 37, 21 - orig: 37, 21 + xy: 710, 54 + size: 37, 35 + orig: 37, 35 + offset: 0, 0 + index: -1 +goblin/right-arm + rotate: false + xy: 708, 2 + size: 23, 50 + orig: 23, 50 offset: 0, 0 index: -1 goblin/right-hand rotate: false - xy: 193, 78 + xy: 749, 54 size: 36, 37 orig: 36, 37 offset: 0, 0 index: -1 goblingirl/right-hand rotate: false - xy: 74, 39 - size: 36, 37 + xy: 733, 15 + size: 35, 37 orig: 36, 37 - offset: 0, 0 + offset: 1, 0 index: -1 -goblingirl/undies +goblin/undies rotate: false - xy: 74, 8 + xy: 787, 62 size: 36, 29 orig: 36, 29 offset: 0, 0 index: -1 +goblingirl/undies + rotate: false + xy: 825, 62 + size: 36, 29 + orig: 36, 29 + offset: 0, 0 + index: -1 +goblingirl/eyes-closed + rotate: false + xy: 59, 6 + size: 37, 15 + orig: 37, 21 + offset: 0, 0 + index: -1 +goblin/eyes-closed + rotate: true + xy: 770, 18 + size: 34, 12 + orig: 34, 12 + offset: 0, 0 + index: -1 diff --git a/spine-cocos2dx/example/Resources/ipadhd/goblins.png b/spine-cocos2dx/example/Resources/ipadhd/goblins.png index 863b29467..1d6f59e37 100644 Binary files a/spine-cocos2dx/example/Resources/ipadhd/goblins.png and b/spine-cocos2dx/example/Resources/ipadhd/goblins.png differ diff --git a/spine-cocos2dx/example/Resources/iphone-retina/goblins.atlas b/spine-cocos2dx/example/Resources/iphone-retina/goblins.atlas index 271742263..ce74602e5 100644 --- a/spine-cocos2dx/example/Resources/iphone-retina/goblins.atlas +++ b/spine-cocos2dx/example/Resources/iphone-retina/goblins.atlas @@ -4,282 +4,282 @@ format: RGBA8888 filter: Linear,Linear repeat: none spear - rotate: false - xy: 2, 142 + rotate: true + xy: 2, 104 size: 22, 368 orig: 22, 368 offset: 0, 0 index: -1 goblingirl/head rotate: false - xy: 26, 429 - size: 103, 81 + xy: 2, 23 + size: 103, 79 orig: 103, 81 - offset: 0, 0 + offset: 0, 2 index: -1 goblin/head rotate: false - xy: 26, 361 - size: 103, 66 + xy: 107, 38 + size: 103, 64 orig: 103, 66 offset: 0, 0 index: -1 goblin/torso - rotate: false - xy: 131, 414 + rotate: true + xy: 212, 34 size: 68, 96 orig: 68, 96 offset: 0, 0 index: -1 -goblingirl/torso +goblin/right-upper-leg + rotate: true + xy: 107, 2 + size: 34, 63 + orig: 34, 63 + offset: 0, 0 + index: -1 +goblin/left-lower-leg + rotate: true + xy: 172, 2 + size: 30, 70 + orig: 33, 70 + offset: 2, 0 + index: -1 +goblingirl/left-lower-leg + rotate: true + xy: 244, 2 + size: 30, 70 + orig: 33, 70 + offset: 2, 0 + index: -1 +goblin/undie-straps rotate: false - xy: 26, 263 - size: 68, 96 - orig: 68, 96 + xy: 2, 2 + size: 55, 19 + orig: 55, 19 offset: 0, 0 index: -1 dagger - rotate: false - xy: 26, 153 + rotate: true + xy: 372, 100 size: 26, 108 - orig: 26, 108 + orig: 156, 238 + offset: 100, 30 + index: -1 +goblingirl/torso + rotate: true + xy: 482, 60 + size: 66, 96 + orig: 68, 96 offset: 0, 0 index: -1 goblin/right-lower-leg - rotate: false - xy: 201, 434 - size: 36, 76 + rotate: true + xy: 580, 91 + size: 35, 76 orig: 36, 76 - offset: 0, 0 + offset: 1, 0 index: -1 goblingirl/right-lower-leg - rotate: false - xy: 54, 185 - size: 36, 76 + rotate: true + xy: 658, 91 + size: 35, 76 orig: 36, 76 - offset: 0, 0 + offset: 1, 0 index: -1 goblin/left-upper-leg - rotate: false - xy: 96, 286 + rotate: true + xy: 736, 93 size: 33, 73 orig: 33, 73 offset: 0, 0 index: -1 goblin/pelvis - rotate: false - xy: 131, 369 + rotate: true + xy: 310, 40 size: 62, 43 orig: 62, 43 offset: 0, 0 index: -1 -goblingirl/pelvis - rotate: false - xy: 131, 324 - size: 62, 43 - orig: 62, 43 - offset: 0, 0 - index: -1 -goblin/right-foot - rotate: false - xy: 131, 289 - size: 63, 33 - orig: 63, 33 - offset: 0, 0 - index: -1 -goblin/left-lower-leg - rotate: false - xy: 2, 70 - size: 33, 70 - orig: 33, 70 - offset: 0, 0 - index: -1 -goblin/right-upper-leg - rotate: false - xy: 2, 5 - size: 34, 63 - orig: 34, 63 - offset: 0, 0 - index: -1 -goblingirl/left-lower-leg - rotate: false - xy: 195, 342 - size: 33, 70 - orig: 33, 70 +goblin/left-hand + rotate: true + xy: 316, 2 + size: 36, 41 + orig: 36, 41 offset: 0, 0 index: -1 goblingirl/left-upper-leg - rotate: false - xy: 37, 81 + rotate: true + xy: 811, 93 size: 33, 70 orig: 33, 70 offset: 0, 0 index: -1 -goblingirl/right-upper-leg - rotate: false - xy: 38, 16 - size: 34, 63 - orig: 34, 63 - offset: 0, 0 - index: -1 -goblin/eyes-closed - rotate: false - xy: 38, 2 - size: 34, 12 - orig: 34, 12 - offset: 0, 0 - index: -1 -goblin/undies - rotate: false - xy: 54, 154 - size: 36, 29 - orig: 36, 29 - offset: 0, 0 - index: -1 -goblin/right-arm - rotate: false - xy: 72, 102 - size: 23, 50 - orig: 23, 50 - offset: 0, 0 - index: -1 goblin/left-foot rotate: false - xy: 131, 256 + xy: 883, 95 size: 65, 31 orig: 65, 31 offset: 0, 0 index: -1 -goblingirl/right-arm - rotate: false - xy: 196, 290 - size: 28, 50 - orig: 28, 50 - offset: 0, 0 - index: -1 -goblingirl/left-shoulder - rotate: false - xy: 226, 294 - size: 28, 46 - orig: 28, 46 - offset: 0, 0 - index: -1 -goblin/left-arm - rotate: false - xy: 198, 253 - size: 37, 35 - orig: 37, 35 - offset: 0, 0 - index: -1 goblingirl/left-foot rotate: false - xy: 92, 223 + xy: 950, 95 size: 65, 31 orig: 65, 31 offset: 0, 0 index: -1 -goblingirl/right-foot +goblin/right-foot rotate: false - xy: 92, 188 + xy: 580, 56 size: 63, 33 orig: 63, 33 offset: 0, 0 index: -1 -goblin/undie-straps +goblingirl/right-foot rotate: false - xy: 92, 167 - size: 55, 19 - orig: 55, 19 + xy: 645, 56 + size: 63, 33 + orig: 63, 33 offset: 0, 0 index: -1 -goblingirl/left-arm +goblingirl/pelvis rotate: false - xy: 159, 219 - size: 37, 35 - orig: 37, 35 + xy: 355, 55 + size: 59, 43 + orig: 62, 43 + offset: 1, 0 + index: -1 +goblingirl/right-upper-leg + rotate: true + xy: 416, 64 + size: 34, 63 + orig: 34, 63 offset: 0, 0 index: -1 goblin/right-shoulder rotate: false - xy: 97, 120 - size: 39, 45 + xy: 359, 11 + size: 39, 42 orig: 39, 45 offset: 0, 0 index: -1 -goblingirl/right-shoulder - rotate: false - xy: 198, 206 - size: 39, 45 - orig: 39, 45 - offset: 0, 0 - index: -1 -goblin/left-hand - rotate: false - xy: 157, 176 - size: 36, 41 - orig: 36, 41 - offset: 0, 0 - index: -1 -goblin/neck - rotate: false - xy: 195, 163 - size: 36, 41 - orig: 36, 41 - offset: 0, 0 - index: -1 goblingirl/undie-straps rotate: false - xy: 97, 99 + xy: 416, 43 size: 55, 19 orig: 55, 19 offset: 0, 0 index: -1 -goblingirl/neck +goblingirl/right-shoulder + rotate: true + xy: 400, 2 + size: 39, 42 + orig: 39, 45 + offset: 0, 0 + index: -1 +goblin/left-arm + rotate: true + xy: 444, 4 + size: 37, 35 + orig: 37, 35 + offset: 0, 0 + index: -1 +goblin/neck rotate: false - xy: 138, 120 - size: 35, 41 - orig: 35, 41 + xy: 481, 17 + size: 36, 41 + orig: 36, 41 offset: 0, 0 index: -1 goblingirl/left-hand rotate: false - xy: 175, 121 + xy: 519, 18 size: 35, 40 orig: 35, 40 offset: 0, 0 index: -1 -goblin/left-shoulder +goblingirl/right-arm rotate: false - xy: 212, 117 + xy: 556, 8 + size: 22, 50 + orig: 28, 50 + offset: 3, 0 + index: -1 +goblingirl/neck + rotate: false + xy: 580, 13 + size: 33, 41 + orig: 35, 41 + offset: 0, 0 + index: -1 +goblin/left-shoulder + rotate: true + xy: 615, 25 size: 29, 44 orig: 29, 44 offset: 0, 0 index: -1 -goblingirl/eyes-closed +goblingirl/left-shoulder + rotate: true + xy: 661, 26 + size: 28, 45 + orig: 28, 46 + offset: 0, 1 + index: -1 +goblingirl/left-arm rotate: false - xy: 154, 97 - size: 37, 21 - orig: 37, 21 + xy: 710, 54 + size: 37, 35 + orig: 37, 35 + offset: 0, 0 + index: -1 +goblin/right-arm + rotate: false + xy: 708, 2 + size: 23, 50 + orig: 23, 50 offset: 0, 0 index: -1 goblin/right-hand rotate: false - xy: 193, 78 + xy: 749, 54 size: 36, 37 orig: 36, 37 offset: 0, 0 index: -1 goblingirl/right-hand rotate: false - xy: 74, 39 - size: 36, 37 + xy: 733, 15 + size: 35, 37 orig: 36, 37 - offset: 0, 0 + offset: 1, 0 index: -1 -goblingirl/undies +goblin/undies rotate: false - xy: 74, 8 + xy: 787, 62 size: 36, 29 orig: 36, 29 offset: 0, 0 index: -1 +goblingirl/undies + rotate: false + xy: 825, 62 + size: 36, 29 + orig: 36, 29 + offset: 0, 0 + index: -1 +goblingirl/eyes-closed + rotate: false + xy: 59, 6 + size: 37, 15 + orig: 37, 21 + offset: 0, 0 + index: -1 +goblin/eyes-closed + rotate: true + xy: 770, 18 + size: 34, 12 + orig: 34, 12 + offset: 0, 0 + index: -1 diff --git a/spine-cocos2dx/example/Resources/iphone-retina/goblins.png b/spine-cocos2dx/example/Resources/iphone-retina/goblins.png index 863b29467..1d6f59e37 100644 Binary files a/spine-cocos2dx/example/Resources/iphone-retina/goblins.png and b/spine-cocos2dx/example/Resources/iphone-retina/goblins.png differ diff --git a/spine-cocos2dx/example/Resources/iphone/goblins.atlas b/spine-cocos2dx/example/Resources/iphone/goblins.atlas index 271742263..ce74602e5 100644 --- a/spine-cocos2dx/example/Resources/iphone/goblins.atlas +++ b/spine-cocos2dx/example/Resources/iphone/goblins.atlas @@ -4,282 +4,282 @@ format: RGBA8888 filter: Linear,Linear repeat: none spear - rotate: false - xy: 2, 142 + rotate: true + xy: 2, 104 size: 22, 368 orig: 22, 368 offset: 0, 0 index: -1 goblingirl/head rotate: false - xy: 26, 429 - size: 103, 81 + xy: 2, 23 + size: 103, 79 orig: 103, 81 - offset: 0, 0 + offset: 0, 2 index: -1 goblin/head rotate: false - xy: 26, 361 - size: 103, 66 + xy: 107, 38 + size: 103, 64 orig: 103, 66 offset: 0, 0 index: -1 goblin/torso - rotate: false - xy: 131, 414 + rotate: true + xy: 212, 34 size: 68, 96 orig: 68, 96 offset: 0, 0 index: -1 -goblingirl/torso +goblin/right-upper-leg + rotate: true + xy: 107, 2 + size: 34, 63 + orig: 34, 63 + offset: 0, 0 + index: -1 +goblin/left-lower-leg + rotate: true + xy: 172, 2 + size: 30, 70 + orig: 33, 70 + offset: 2, 0 + index: -1 +goblingirl/left-lower-leg + rotate: true + xy: 244, 2 + size: 30, 70 + orig: 33, 70 + offset: 2, 0 + index: -1 +goblin/undie-straps rotate: false - xy: 26, 263 - size: 68, 96 - orig: 68, 96 + xy: 2, 2 + size: 55, 19 + orig: 55, 19 offset: 0, 0 index: -1 dagger - rotate: false - xy: 26, 153 + rotate: true + xy: 372, 100 size: 26, 108 - orig: 26, 108 + orig: 156, 238 + offset: 100, 30 + index: -1 +goblingirl/torso + rotate: true + xy: 482, 60 + size: 66, 96 + orig: 68, 96 offset: 0, 0 index: -1 goblin/right-lower-leg - rotate: false - xy: 201, 434 - size: 36, 76 + rotate: true + xy: 580, 91 + size: 35, 76 orig: 36, 76 - offset: 0, 0 + offset: 1, 0 index: -1 goblingirl/right-lower-leg - rotate: false - xy: 54, 185 - size: 36, 76 + rotate: true + xy: 658, 91 + size: 35, 76 orig: 36, 76 - offset: 0, 0 + offset: 1, 0 index: -1 goblin/left-upper-leg - rotate: false - xy: 96, 286 + rotate: true + xy: 736, 93 size: 33, 73 orig: 33, 73 offset: 0, 0 index: -1 goblin/pelvis - rotate: false - xy: 131, 369 + rotate: true + xy: 310, 40 size: 62, 43 orig: 62, 43 offset: 0, 0 index: -1 -goblingirl/pelvis - rotate: false - xy: 131, 324 - size: 62, 43 - orig: 62, 43 - offset: 0, 0 - index: -1 -goblin/right-foot - rotate: false - xy: 131, 289 - size: 63, 33 - orig: 63, 33 - offset: 0, 0 - index: -1 -goblin/left-lower-leg - rotate: false - xy: 2, 70 - size: 33, 70 - orig: 33, 70 - offset: 0, 0 - index: -1 -goblin/right-upper-leg - rotate: false - xy: 2, 5 - size: 34, 63 - orig: 34, 63 - offset: 0, 0 - index: -1 -goblingirl/left-lower-leg - rotate: false - xy: 195, 342 - size: 33, 70 - orig: 33, 70 +goblin/left-hand + rotate: true + xy: 316, 2 + size: 36, 41 + orig: 36, 41 offset: 0, 0 index: -1 goblingirl/left-upper-leg - rotate: false - xy: 37, 81 + rotate: true + xy: 811, 93 size: 33, 70 orig: 33, 70 offset: 0, 0 index: -1 -goblingirl/right-upper-leg - rotate: false - xy: 38, 16 - size: 34, 63 - orig: 34, 63 - offset: 0, 0 - index: -1 -goblin/eyes-closed - rotate: false - xy: 38, 2 - size: 34, 12 - orig: 34, 12 - offset: 0, 0 - index: -1 -goblin/undies - rotate: false - xy: 54, 154 - size: 36, 29 - orig: 36, 29 - offset: 0, 0 - index: -1 -goblin/right-arm - rotate: false - xy: 72, 102 - size: 23, 50 - orig: 23, 50 - offset: 0, 0 - index: -1 goblin/left-foot rotate: false - xy: 131, 256 + xy: 883, 95 size: 65, 31 orig: 65, 31 offset: 0, 0 index: -1 -goblingirl/right-arm - rotate: false - xy: 196, 290 - size: 28, 50 - orig: 28, 50 - offset: 0, 0 - index: -1 -goblingirl/left-shoulder - rotate: false - xy: 226, 294 - size: 28, 46 - orig: 28, 46 - offset: 0, 0 - index: -1 -goblin/left-arm - rotate: false - xy: 198, 253 - size: 37, 35 - orig: 37, 35 - offset: 0, 0 - index: -1 goblingirl/left-foot rotate: false - xy: 92, 223 + xy: 950, 95 size: 65, 31 orig: 65, 31 offset: 0, 0 index: -1 -goblingirl/right-foot +goblin/right-foot rotate: false - xy: 92, 188 + xy: 580, 56 size: 63, 33 orig: 63, 33 offset: 0, 0 index: -1 -goblin/undie-straps +goblingirl/right-foot rotate: false - xy: 92, 167 - size: 55, 19 - orig: 55, 19 + xy: 645, 56 + size: 63, 33 + orig: 63, 33 offset: 0, 0 index: -1 -goblingirl/left-arm +goblingirl/pelvis rotate: false - xy: 159, 219 - size: 37, 35 - orig: 37, 35 + xy: 355, 55 + size: 59, 43 + orig: 62, 43 + offset: 1, 0 + index: -1 +goblingirl/right-upper-leg + rotate: true + xy: 416, 64 + size: 34, 63 + orig: 34, 63 offset: 0, 0 index: -1 goblin/right-shoulder rotate: false - xy: 97, 120 - size: 39, 45 + xy: 359, 11 + size: 39, 42 orig: 39, 45 offset: 0, 0 index: -1 -goblingirl/right-shoulder - rotate: false - xy: 198, 206 - size: 39, 45 - orig: 39, 45 - offset: 0, 0 - index: -1 -goblin/left-hand - rotate: false - xy: 157, 176 - size: 36, 41 - orig: 36, 41 - offset: 0, 0 - index: -1 -goblin/neck - rotate: false - xy: 195, 163 - size: 36, 41 - orig: 36, 41 - offset: 0, 0 - index: -1 goblingirl/undie-straps rotate: false - xy: 97, 99 + xy: 416, 43 size: 55, 19 orig: 55, 19 offset: 0, 0 index: -1 -goblingirl/neck +goblingirl/right-shoulder + rotate: true + xy: 400, 2 + size: 39, 42 + orig: 39, 45 + offset: 0, 0 + index: -1 +goblin/left-arm + rotate: true + xy: 444, 4 + size: 37, 35 + orig: 37, 35 + offset: 0, 0 + index: -1 +goblin/neck rotate: false - xy: 138, 120 - size: 35, 41 - orig: 35, 41 + xy: 481, 17 + size: 36, 41 + orig: 36, 41 offset: 0, 0 index: -1 goblingirl/left-hand rotate: false - xy: 175, 121 + xy: 519, 18 size: 35, 40 orig: 35, 40 offset: 0, 0 index: -1 -goblin/left-shoulder +goblingirl/right-arm rotate: false - xy: 212, 117 + xy: 556, 8 + size: 22, 50 + orig: 28, 50 + offset: 3, 0 + index: -1 +goblingirl/neck + rotate: false + xy: 580, 13 + size: 33, 41 + orig: 35, 41 + offset: 0, 0 + index: -1 +goblin/left-shoulder + rotate: true + xy: 615, 25 size: 29, 44 orig: 29, 44 offset: 0, 0 index: -1 -goblingirl/eyes-closed +goblingirl/left-shoulder + rotate: true + xy: 661, 26 + size: 28, 45 + orig: 28, 46 + offset: 0, 1 + index: -1 +goblingirl/left-arm rotate: false - xy: 154, 97 - size: 37, 21 - orig: 37, 21 + xy: 710, 54 + size: 37, 35 + orig: 37, 35 + offset: 0, 0 + index: -1 +goblin/right-arm + rotate: false + xy: 708, 2 + size: 23, 50 + orig: 23, 50 offset: 0, 0 index: -1 goblin/right-hand rotate: false - xy: 193, 78 + xy: 749, 54 size: 36, 37 orig: 36, 37 offset: 0, 0 index: -1 goblingirl/right-hand rotate: false - xy: 74, 39 - size: 36, 37 + xy: 733, 15 + size: 35, 37 orig: 36, 37 - offset: 0, 0 + offset: 1, 0 index: -1 -goblingirl/undies +goblin/undies rotate: false - xy: 74, 8 + xy: 787, 62 size: 36, 29 orig: 36, 29 offset: 0, 0 index: -1 +goblingirl/undies + rotate: false + xy: 825, 62 + size: 36, 29 + orig: 36, 29 + offset: 0, 0 + index: -1 +goblingirl/eyes-closed + rotate: false + xy: 59, 6 + size: 37, 15 + orig: 37, 21 + offset: 0, 0 + index: -1 +goblin/eyes-closed + rotate: true + xy: 770, 18 + size: 34, 12 + orig: 34, 12 + offset: 0, 0 + index: -1 diff --git a/spine-cocos2dx/example/Resources/iphone/goblins.png b/spine-cocos2dx/example/Resources/iphone/goblins.png index 863b29467..1d6f59e37 100644 Binary files a/spine-cocos2dx/example/Resources/iphone/goblins.png and b/spine-cocos2dx/example/Resources/iphone/goblins.png differ diff --git a/spine-cocos2dx/example/raw/images/bow.png b/spine-cocos2dx/example/raw/images/bow.png deleted file mode 100755 index df8994bce..000000000 Binary files a/spine-cocos2dx/example/raw/images/bow.png and /dev/null differ diff --git a/spine-cocos2dx/example/raw/images/eyes-closed.png b/spine-cocos2dx/example/raw/images/eyes-closed.png deleted file mode 100755 index 60718e101..000000000 Binary files a/spine-cocos2dx/example/raw/images/eyes-closed.png and /dev/null differ diff --git a/spine-cocos2dx/example/raw/images/eyes.png b/spine-cocos2dx/example/raw/images/eyes.png deleted file mode 100755 index 707c91b72..000000000 Binary files a/spine-cocos2dx/example/raw/images/eyes.png and /dev/null differ diff --git a/spine-cocos2dx/example/raw/images/head.png b/spine-cocos2dx/example/raw/images/head.png deleted file mode 100755 index 5a98aa37a..000000000 Binary files a/spine-cocos2dx/example/raw/images/head.png and /dev/null differ diff --git a/spine-cocos2dx/example/raw/images/left-ankle.png b/spine-cocos2dx/example/raw/images/left-ankle.png deleted file mode 100755 index fcf9a2813..000000000 Binary files a/spine-cocos2dx/example/raw/images/left-ankle.png and /dev/null differ diff --git a/spine-cocos2dx/example/raw/images/left-arm.png b/spine-cocos2dx/example/raw/images/left-arm.png deleted file mode 100755 index 4447dec8a..000000000 Binary files a/spine-cocos2dx/example/raw/images/left-arm.png and /dev/null differ diff --git a/spine-cocos2dx/example/raw/images/left-foot.png b/spine-cocos2dx/example/raw/images/left-foot.png deleted file mode 100755 index 9b8768277..000000000 Binary files a/spine-cocos2dx/example/raw/images/left-foot.png and /dev/null differ diff --git a/spine-cocos2dx/example/raw/images/left-hand.png b/spine-cocos2dx/example/raw/images/left-hand.png deleted file mode 100755 index b95a3523c..000000000 Binary files a/spine-cocos2dx/example/raw/images/left-hand.png and /dev/null differ diff --git a/spine-cocos2dx/example/raw/images/left-lower-leg.png b/spine-cocos2dx/example/raw/images/left-lower-leg.png deleted file mode 100755 index f316b6500..000000000 Binary files a/spine-cocos2dx/example/raw/images/left-lower-leg.png and /dev/null differ diff --git a/spine-cocos2dx/example/raw/images/left-pant-bottom.png b/spine-cocos2dx/example/raw/images/left-pant-bottom.png deleted file mode 100755 index 29a05bc4f..000000000 Binary files a/spine-cocos2dx/example/raw/images/left-pant-bottom.png and /dev/null differ diff --git a/spine-cocos2dx/example/raw/images/left-shoulder.png b/spine-cocos2dx/example/raw/images/left-shoulder.png deleted file mode 100755 index 7fd429dc3..000000000 Binary files a/spine-cocos2dx/example/raw/images/left-shoulder.png and /dev/null differ diff --git a/spine-cocos2dx/example/raw/images/left-upper-leg.png b/spine-cocos2dx/example/raw/images/left-upper-leg.png deleted file mode 100755 index f076d5c91..000000000 Binary files a/spine-cocos2dx/example/raw/images/left-upper-leg.png and /dev/null differ diff --git a/spine-cocos2dx/example/raw/images/neck.png b/spine-cocos2dx/example/raw/images/neck.png deleted file mode 100755 index c7b938863..000000000 Binary files a/spine-cocos2dx/example/raw/images/neck.png and /dev/null differ diff --git a/spine-cocos2dx/example/raw/images/pack.json b/spine-cocos2dx/example/raw/images/pack.json deleted file mode 100755 index 4e702ea9b..000000000 --- a/spine-cocos2dx/example/raw/images/pack.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - pot: true, - paddingX: 2, - paddingY: 2, - duplicatePadding: false, - filterMin: Linear, - filterMag: Linear, -} \ No newline at end of file diff --git a/spine-cocos2dx/example/raw/images/pelvis.png b/spine-cocos2dx/example/raw/images/pelvis.png deleted file mode 100755 index f52c33cdd..000000000 Binary files a/spine-cocos2dx/example/raw/images/pelvis.png and /dev/null differ diff --git a/spine-cocos2dx/example/raw/images/right-ankle.png b/spine-cocos2dx/example/raw/images/right-ankle.png deleted file mode 100755 index 92fc568cf..000000000 Binary files a/spine-cocos2dx/example/raw/images/right-ankle.png and /dev/null differ diff --git a/spine-cocos2dx/example/raw/images/right-arm.png b/spine-cocos2dx/example/raw/images/right-arm.png deleted file mode 100755 index cac970f4b..000000000 Binary files a/spine-cocos2dx/example/raw/images/right-arm.png and /dev/null differ diff --git a/spine-cocos2dx/example/raw/images/right-foot-idle.png b/spine-cocos2dx/example/raw/images/right-foot-idle.png deleted file mode 100755 index aaf609f4e..000000000 Binary files a/spine-cocos2dx/example/raw/images/right-foot-idle.png and /dev/null differ diff --git a/spine-cocos2dx/example/raw/images/right-foot.png b/spine-cocos2dx/example/raw/images/right-foot.png deleted file mode 100755 index 7a06bf2de..000000000 Binary files a/spine-cocos2dx/example/raw/images/right-foot.png and /dev/null differ diff --git a/spine-cocos2dx/example/raw/images/right-hand.png b/spine-cocos2dx/example/raw/images/right-hand.png deleted file mode 100755 index 17c62bf4a..000000000 Binary files a/spine-cocos2dx/example/raw/images/right-hand.png and /dev/null differ diff --git a/spine-cocos2dx/example/raw/images/right-lower-leg.png b/spine-cocos2dx/example/raw/images/right-lower-leg.png deleted file mode 100755 index 1f00e8ec9..000000000 Binary files a/spine-cocos2dx/example/raw/images/right-lower-leg.png and /dev/null differ diff --git a/spine-cocos2dx/example/raw/images/right-pant-bottom.png b/spine-cocos2dx/example/raw/images/right-pant-bottom.png deleted file mode 100755 index 73309c05d..000000000 Binary files a/spine-cocos2dx/example/raw/images/right-pant-bottom.png and /dev/null differ diff --git a/spine-cocos2dx/example/raw/images/right-shoulder.png b/spine-cocos2dx/example/raw/images/right-shoulder.png deleted file mode 100755 index 23e9a2fd1..000000000 Binary files a/spine-cocos2dx/example/raw/images/right-shoulder.png and /dev/null differ diff --git a/spine-cocos2dx/example/raw/images/right-upper-leg.png b/spine-cocos2dx/example/raw/images/right-upper-leg.png deleted file mode 100755 index df0b11661..000000000 Binary files a/spine-cocos2dx/example/raw/images/right-upper-leg.png and /dev/null differ diff --git a/spine-cocos2dx/example/raw/images/torso.png b/spine-cocos2dx/example/raw/images/torso.png deleted file mode 100755 index d5a318e72..000000000 Binary files a/spine-cocos2dx/example/raw/images/torso.png and /dev/null differ diff --git a/spine-cocos2dx/example/raw/spineboy.spine b/spine-cocos2dx/example/raw/spineboy.spine deleted file mode 100644 index 562b34880..000000000 Binary files a/spine-cocos2dx/example/raw/spineboy.spine and /dev/null differ diff --git a/spine-cocos2dx/example/raw/spineboy.tps b/spine-cocos2dx/example/raw/spineboy.tps deleted file mode 100644 index d5d8c92e8..000000000 --- a/spine-cocos2dx/example/raw/spineboy.tps +++ /dev/null @@ -1,171 +0,0 @@ - - - - fileFormatVersion - 1 - variation - main - verbose - - autoSDSettings - - - scale - 0.5 - extension - /iphone/ - acceptFractionalValues - - maxTextureSize - - width - 2048 - height - 2048 - - - - allowRotation - - quiet - - premultiplyAlpha - - shapeDebug - - dpi - 72 - dataFormat - libgdx - textureFileName - ../Resources/iphone-retina/spineboy.png - flipPVR - - ditherType - NearestNeighbour - backgroundColor - 0 - libGdx - - filtering - - x - Linear - y - Linear - - - shapePadding - 2 - jpgQuality - 80 - pngOptimizationLevel - 0 - textureSubPath - - textureFormat - png - borderPadding - 2 - maxTextureSize - - width - 2048 - height - 2048 - - fixedTextureSize - - width - -1 - height - -1 - - reduceBorderArtifacts - - algorithmSettings - - algorithm - MaxRects - freeSizeMode - Best - sizeConstraints - NPOT - forceSquared - - forceWordAligned - - maxRects - - heuristic - Best - - basic - - sortBy - Best - order - Ascending - - - andEngine - - minFilter - Linear - packageName - Texture - javaFileName - ../Resources/data/spineboy2.java - wrap - - s - Clamp - t - Clamp - - magFilter - MagLinear - - dataFileName - ../Resources/iphone-retina/spineboy.txt - mainExtension - /iphone-retina/ - forceIdenticalLayout - - outputFormat - RGBA8888 - autoAliasEnabled - - trimSpriteNames - - globalSpriteSettings - - scale - 1 - scaleMode - Smooth - innerPadding - 0 - extrude - 0 - trimThreshold - 1 - trimMode - Trim - heuristicMask - - - fileList - - images - - ignoreFileList - - replaceList - - commonDivisorX - 1 - commonDivisorY - 1 - - diff --git a/spine-cocos2dx/src/spine/spine-cocos2dx.cpp b/spine-cocos2dx/src/spine/spine-cocos2dx.cpp index 9b7a0409f..55b43ca4d 100644 --- a/spine-cocos2dx/src/spine/spine-cocos2dx.cpp +++ b/spine-cocos2dx/src/spine/spine-cocos2dx.cpp @@ -87,25 +87,14 @@ void RegionAttachment_updateQuad (RegionAttachment* self, Slot* slot, ccV3F_C4B_ quad->br.vertices.x = self->vertices[VERTEX_X4]; quad->br.vertices.y = self->vertices[VERTEX_Y4]; - if (self->region->rotate) { - quad->tl.texCoords.u = self->region->u; - quad->tl.texCoords.v = self->region->v2; - quad->tr.texCoords.u = self->region->u; - quad->tr.texCoords.v = self->region->v; - quad->br.texCoords.u = self->region->u2; - quad->br.texCoords.v = self->region->v; - quad->bl.texCoords.u = self->region->u2; - quad->bl.texCoords.v = self->region->v2; - } else { - quad->bl.texCoords.u = self->region->u; - quad->bl.texCoords.v = self->region->v2; - quad->tl.texCoords.u = self->region->u; - quad->tl.texCoords.v = self->region->v; - quad->tr.texCoords.u = self->region->u2; - quad->tr.texCoords.v = self->region->v; - quad->br.texCoords.u = self->region->u2; - quad->br.texCoords.v = self->region->v2; - } + quad->bl.texCoords.u = self->uvs[VERTEX_X1]; + quad->bl.texCoords.v = self->uvs[VERTEX_Y1]; + quad->tl.texCoords.u = self->uvs[VERTEX_X2]; + quad->tl.texCoords.v = self->uvs[VERTEX_Y2]; + quad->tr.texCoords.u = self->uvs[VERTEX_X3]; + quad->tr.texCoords.v = self->uvs[VERTEX_Y3]; + quad->br.texCoords.u = self->uvs[VERTEX_X4]; + quad->br.texCoords.v = self->uvs[VERTEX_Y4]; } /**/ @@ -114,6 +103,7 @@ CCSkeleton* CCSkeleton::createWithFile (const char* skeletonDataFile, Atlas* atl SkeletonJson* json = SkeletonJson_create(atlas); json->scale = scale; SkeletonData* skeletonData = SkeletonJson_readSkeletonDataFile(json, skeletonDataFile); + CCAssert(skeletonData, json->error ? json->error : "Error reading skeleton data."); SkeletonJson_dispose(json); CCSkeleton* node = skeletonData ? createWithData(skeletonData) : 0; node->ownsSkeleton = true; @@ -122,10 +112,12 @@ CCSkeleton* CCSkeleton::createWithFile (const char* skeletonDataFile, Atlas* atl CCSkeleton* CCSkeleton::createWithFile (const char* skeletonDataFile, const char* atlasFile, float scale) { Atlas* atlas = Atlas_readAtlasFile(atlasFile); + CCAssert(atlas, "Error reading atlas file."); if (!atlas) return 0; SkeletonJson* json = SkeletonJson_create(atlas); json->scale = scale; SkeletonData* skeletonData = SkeletonJson_readSkeletonDataFile(json, skeletonDataFile); + CCAssert(skeletonData, json->error ? json->error : "Error reading skeleton data file."); SkeletonJson_dispose(json); if (!skeletonData) { Atlas_dispose(atlas); @@ -197,7 +189,7 @@ void CCSkeleton::draw () { Slot* slot = skeleton->slots[i]; if (!slot->attachment || slot->attachment->type != ATTACHMENT_REGION) continue; RegionAttachment* attachment = (RegionAttachment*)slot->attachment; - CCTextureAtlas* regionTextureAtlas = (CCTextureAtlas*)attachment->region->page->texture; + CCTextureAtlas* regionTextureAtlas = (CCTextureAtlas*)attachment->texture; if (regionTextureAtlas != textureAtlas) { if (textureAtlas) { textureAtlas->drawQuads(); diff --git a/spine-csharp/src/Atlas.cs b/spine-csharp/src/Atlas.cs index 421668136..1951533c0 100644 --- a/spine-csharp/src/Atlas.cs +++ b/spine-csharp/src/Atlas.cs @@ -98,8 +98,13 @@ namespace Spine { region.u = x / (float)page.width; region.v = y / (float)page.height; - region.u2 = (x + width) / (float)page.width; - region.v2 = (y + height) / (float)page.height; + if (region.rotate) { + region.u2 = (x + height) / (float)page.width; + region.v2 = (y + width) / (float)page.height; + } else { + region.u2 = (x + width) / (float)page.width; + region.v2 = (y + height) / (float)page.height; + } region.x = x; region.y = y; region.width = Math.Abs(width); diff --git a/spine-csharp/src/Attachments/AtlasAttachmentLoader.cs b/spine-csharp/src/Attachments/AtlasAttachmentLoader.cs index 28f44658f..b2749d7b3 100644 --- a/spine-csharp/src/Attachments/AtlasAttachmentLoader.cs +++ b/spine-csharp/src/Attachments/AtlasAttachmentLoader.cs @@ -40,7 +40,14 @@ namespace Spine { AtlasRegion region = atlas.FindRegion(name); if (region == null) throw new Exception("Region not found in atlas: " + name + " (" + type + ")"); RegionAttachment attachment = new RegionAttachment(name); - attachment.Region = region; + attachment.Texture = region.page.texture; + attachment.SetUVs(region.u, region.v, region.u2, region.v2, region.rotate); + attachment.RegionOffsetX = region.offsetX; + attachment.RegionOffsetY = region.offsetY; + attachment.RegionWidth = region.width; + attachment.RegionHeight = region.height; + attachment.RegionOriginalWidth = region.originalWidth; + attachment.RegionOriginalHeight = region.originalHeight; return attachment; } throw new Exception("Unknown attachment type: " + type); diff --git a/spine-csharp/src/Attachments/RegionAttachment.cs b/spine-csharp/src/Attachments/RegionAttachment.cs index 11a7cf95e..e2cc62928 100644 --- a/spine-csharp/src/Attachments/RegionAttachment.cs +++ b/spine-csharp/src/Attachments/RegionAttachment.cs @@ -45,45 +45,61 @@ namespace Spine { public float Width { get; set; } public float Height { get; set; } + public Object Texture { get; set; } + public float RegionOffsetX { get; set; } + public float RegionOffsetY { get; set; } // Pixels stripped from the bottom left, unrotated. + public float RegionWidth { get; set; } + public float RegionHeight { get; set; } // Unrotated, stripped size. + public float RegionOriginalWidth { get; set; } + public float RegionOriginalHeight { get; set; } // Unrotated, unstripped size. + public float[] Offset { get; private set; } public float[] Vertices { get; private set; } - public AtlasRegion Region { get; set; } + public float[] UVs { get; private set; } public RegionAttachment (string name) : base(name) { Offset = new float[8]; Vertices = new float[8]; + UVs = new float[8]; ScaleX = 1; ScaleY = 1; } + public void SetUVs (float u, float v, float u2, float v2, bool rotate) { + float[] uvs = UVs; + if (rotate) { + uvs[X2] = u; + uvs[Y2] = v2; + uvs[X3] = u; + uvs[Y3] = v; + uvs[X4] = u2; + uvs[Y4] = v; + uvs[X1] = u2; + uvs[Y1] = v2; + } else { + uvs[X1] = u; + uvs[Y1] = v2; + uvs[X2] = u; + uvs[Y2] = v; + uvs[X3] = u2; + uvs[Y3] = v; + uvs[X4] = u2; + uvs[Y4] = v2; + } + } + public void UpdateOffset () { float width = Width; float height = Height; - float localX2 = width / 2; - float localY2 = height / 2; - float localX = -localX2; - float localY = -localY2; - AtlasRegion region = Region; - if (region != null) { - if (region.rotate) { - localX += region.offsetX / region.originalWidth * height; - localY += region.offsetY / region.originalHeight * width; - localX2 -= (region.originalWidth - region.offsetX - region.height) / region.originalWidth * width; - localY2 -= (region.originalHeight - region.offsetY - region.width) / region.originalHeight * height; - } else { - localX += region.offsetX / region.originalWidth * width; - localY += region.offsetY / region.originalHeight * height; - localX2 -= (region.originalWidth - region.offsetX - region.width) / region.originalWidth * width; - localY2 -= (region.originalHeight - region.offsetY - region.height) / region.originalHeight * height; - } - } float scaleX = ScaleX; float scaleY = ScaleY; - localX *= scaleX; - localY *= scaleY; - localX2 *= scaleX; - localY2 *= scaleY; + float regionScaleX = width / RegionOriginalWidth * scaleX; + float regionScaleY = height / RegionOriginalHeight * scaleX; + float localX = -width / 2 * scaleX + RegionOffsetX * regionScaleX; + float localY = -height / 2 * scaleX + RegionOffsetY * regionScaleY; + float localX2 = localX + RegionWidth * regionScaleX; + float localY2 = localY + RegionHeight * regionScaleY; float radians = Rotation * (float)Math.PI / 180; float cos = (float)Math.Cos(radians); float sin = (float)Math.Sin(radians); diff --git a/spine-libgdx/src/com/esotericsoftware/spine/attachments/RegionAttachment.java b/spine-libgdx/src/com/esotericsoftware/spine/attachments/RegionAttachment.java index a55307311..3ade078cd 100644 --- a/spine-libgdx/src/com/esotericsoftware/spine/attachments/RegionAttachment.java +++ b/spine-libgdx/src/com/esotericsoftware/spine/attachments/RegionAttachment.java @@ -60,8 +60,8 @@ public class RegionAttachment extends Attachment { if (region.rotate) { localX += region.offsetX / region.originalWidth * height; localY += region.offsetY / region.originalHeight * width; - localX2 -= (region.originalWidth - region.offsetX - region.packedHeight) / region.originalWidth * width; - localY2 -= (region.originalHeight - region.offsetY - region.packedWidth) / region.originalHeight * height; + localX2 -= (region.originalWidth - region.offsetX - region.packedHeight) / region.originalWidth * height; + localY2 -= (region.originalHeight - region.offsetY - region.packedWidth) / region.originalHeight * width; } else { localX += region.offsetX / region.originalWidth * width; localY += region.offsetY / region.originalHeight * height; diff --git a/spine-sfml/data/goblins.atlas b/spine-sfml/data/goblins.atlas index 271742263..ce74602e5 100644 --- a/spine-sfml/data/goblins.atlas +++ b/spine-sfml/data/goblins.atlas @@ -4,282 +4,282 @@ format: RGBA8888 filter: Linear,Linear repeat: none spear - rotate: false - xy: 2, 142 + rotate: true + xy: 2, 104 size: 22, 368 orig: 22, 368 offset: 0, 0 index: -1 goblingirl/head rotate: false - xy: 26, 429 - size: 103, 81 + xy: 2, 23 + size: 103, 79 orig: 103, 81 - offset: 0, 0 + offset: 0, 2 index: -1 goblin/head rotate: false - xy: 26, 361 - size: 103, 66 + xy: 107, 38 + size: 103, 64 orig: 103, 66 offset: 0, 0 index: -1 goblin/torso - rotate: false - xy: 131, 414 + rotate: true + xy: 212, 34 size: 68, 96 orig: 68, 96 offset: 0, 0 index: -1 -goblingirl/torso +goblin/right-upper-leg + rotate: true + xy: 107, 2 + size: 34, 63 + orig: 34, 63 + offset: 0, 0 + index: -1 +goblin/left-lower-leg + rotate: true + xy: 172, 2 + size: 30, 70 + orig: 33, 70 + offset: 2, 0 + index: -1 +goblingirl/left-lower-leg + rotate: true + xy: 244, 2 + size: 30, 70 + orig: 33, 70 + offset: 2, 0 + index: -1 +goblin/undie-straps rotate: false - xy: 26, 263 - size: 68, 96 - orig: 68, 96 + xy: 2, 2 + size: 55, 19 + orig: 55, 19 offset: 0, 0 index: -1 dagger - rotate: false - xy: 26, 153 + rotate: true + xy: 372, 100 size: 26, 108 - orig: 26, 108 + orig: 156, 238 + offset: 100, 30 + index: -1 +goblingirl/torso + rotate: true + xy: 482, 60 + size: 66, 96 + orig: 68, 96 offset: 0, 0 index: -1 goblin/right-lower-leg - rotate: false - xy: 201, 434 - size: 36, 76 + rotate: true + xy: 580, 91 + size: 35, 76 orig: 36, 76 - offset: 0, 0 + offset: 1, 0 index: -1 goblingirl/right-lower-leg - rotate: false - xy: 54, 185 - size: 36, 76 + rotate: true + xy: 658, 91 + size: 35, 76 orig: 36, 76 - offset: 0, 0 + offset: 1, 0 index: -1 goblin/left-upper-leg - rotate: false - xy: 96, 286 + rotate: true + xy: 736, 93 size: 33, 73 orig: 33, 73 offset: 0, 0 index: -1 goblin/pelvis - rotate: false - xy: 131, 369 + rotate: true + xy: 310, 40 size: 62, 43 orig: 62, 43 offset: 0, 0 index: -1 -goblingirl/pelvis - rotate: false - xy: 131, 324 - size: 62, 43 - orig: 62, 43 - offset: 0, 0 - index: -1 -goblin/right-foot - rotate: false - xy: 131, 289 - size: 63, 33 - orig: 63, 33 - offset: 0, 0 - index: -1 -goblin/left-lower-leg - rotate: false - xy: 2, 70 - size: 33, 70 - orig: 33, 70 - offset: 0, 0 - index: -1 -goblin/right-upper-leg - rotate: false - xy: 2, 5 - size: 34, 63 - orig: 34, 63 - offset: 0, 0 - index: -1 -goblingirl/left-lower-leg - rotate: false - xy: 195, 342 - size: 33, 70 - orig: 33, 70 +goblin/left-hand + rotate: true + xy: 316, 2 + size: 36, 41 + orig: 36, 41 offset: 0, 0 index: -1 goblingirl/left-upper-leg - rotate: false - xy: 37, 81 + rotate: true + xy: 811, 93 size: 33, 70 orig: 33, 70 offset: 0, 0 index: -1 -goblingirl/right-upper-leg - rotate: false - xy: 38, 16 - size: 34, 63 - orig: 34, 63 - offset: 0, 0 - index: -1 -goblin/eyes-closed - rotate: false - xy: 38, 2 - size: 34, 12 - orig: 34, 12 - offset: 0, 0 - index: -1 -goblin/undies - rotate: false - xy: 54, 154 - size: 36, 29 - orig: 36, 29 - offset: 0, 0 - index: -1 -goblin/right-arm - rotate: false - xy: 72, 102 - size: 23, 50 - orig: 23, 50 - offset: 0, 0 - index: -1 goblin/left-foot rotate: false - xy: 131, 256 + xy: 883, 95 size: 65, 31 orig: 65, 31 offset: 0, 0 index: -1 -goblingirl/right-arm - rotate: false - xy: 196, 290 - size: 28, 50 - orig: 28, 50 - offset: 0, 0 - index: -1 -goblingirl/left-shoulder - rotate: false - xy: 226, 294 - size: 28, 46 - orig: 28, 46 - offset: 0, 0 - index: -1 -goblin/left-arm - rotate: false - xy: 198, 253 - size: 37, 35 - orig: 37, 35 - offset: 0, 0 - index: -1 goblingirl/left-foot rotate: false - xy: 92, 223 + xy: 950, 95 size: 65, 31 orig: 65, 31 offset: 0, 0 index: -1 -goblingirl/right-foot +goblin/right-foot rotate: false - xy: 92, 188 + xy: 580, 56 size: 63, 33 orig: 63, 33 offset: 0, 0 index: -1 -goblin/undie-straps +goblingirl/right-foot rotate: false - xy: 92, 167 - size: 55, 19 - orig: 55, 19 + xy: 645, 56 + size: 63, 33 + orig: 63, 33 offset: 0, 0 index: -1 -goblingirl/left-arm +goblingirl/pelvis rotate: false - xy: 159, 219 - size: 37, 35 - orig: 37, 35 + xy: 355, 55 + size: 59, 43 + orig: 62, 43 + offset: 1, 0 + index: -1 +goblingirl/right-upper-leg + rotate: true + xy: 416, 64 + size: 34, 63 + orig: 34, 63 offset: 0, 0 index: -1 goblin/right-shoulder rotate: false - xy: 97, 120 - size: 39, 45 + xy: 359, 11 + size: 39, 42 orig: 39, 45 offset: 0, 0 index: -1 -goblingirl/right-shoulder - rotate: false - xy: 198, 206 - size: 39, 45 - orig: 39, 45 - offset: 0, 0 - index: -1 -goblin/left-hand - rotate: false - xy: 157, 176 - size: 36, 41 - orig: 36, 41 - offset: 0, 0 - index: -1 -goblin/neck - rotate: false - xy: 195, 163 - size: 36, 41 - orig: 36, 41 - offset: 0, 0 - index: -1 goblingirl/undie-straps rotate: false - xy: 97, 99 + xy: 416, 43 size: 55, 19 orig: 55, 19 offset: 0, 0 index: -1 -goblingirl/neck +goblingirl/right-shoulder + rotate: true + xy: 400, 2 + size: 39, 42 + orig: 39, 45 + offset: 0, 0 + index: -1 +goblin/left-arm + rotate: true + xy: 444, 4 + size: 37, 35 + orig: 37, 35 + offset: 0, 0 + index: -1 +goblin/neck rotate: false - xy: 138, 120 - size: 35, 41 - orig: 35, 41 + xy: 481, 17 + size: 36, 41 + orig: 36, 41 offset: 0, 0 index: -1 goblingirl/left-hand rotate: false - xy: 175, 121 + xy: 519, 18 size: 35, 40 orig: 35, 40 offset: 0, 0 index: -1 -goblin/left-shoulder +goblingirl/right-arm rotate: false - xy: 212, 117 + xy: 556, 8 + size: 22, 50 + orig: 28, 50 + offset: 3, 0 + index: -1 +goblingirl/neck + rotate: false + xy: 580, 13 + size: 33, 41 + orig: 35, 41 + offset: 0, 0 + index: -1 +goblin/left-shoulder + rotate: true + xy: 615, 25 size: 29, 44 orig: 29, 44 offset: 0, 0 index: -1 -goblingirl/eyes-closed +goblingirl/left-shoulder + rotate: true + xy: 661, 26 + size: 28, 45 + orig: 28, 46 + offset: 0, 1 + index: -1 +goblingirl/left-arm rotate: false - xy: 154, 97 - size: 37, 21 - orig: 37, 21 + xy: 710, 54 + size: 37, 35 + orig: 37, 35 + offset: 0, 0 + index: -1 +goblin/right-arm + rotate: false + xy: 708, 2 + size: 23, 50 + orig: 23, 50 offset: 0, 0 index: -1 goblin/right-hand rotate: false - xy: 193, 78 + xy: 749, 54 size: 36, 37 orig: 36, 37 offset: 0, 0 index: -1 goblingirl/right-hand rotate: false - xy: 74, 39 - size: 36, 37 + xy: 733, 15 + size: 35, 37 orig: 36, 37 - offset: 0, 0 + offset: 1, 0 index: -1 -goblingirl/undies +goblin/undies rotate: false - xy: 74, 8 + xy: 787, 62 size: 36, 29 orig: 36, 29 offset: 0, 0 index: -1 +goblingirl/undies + rotate: false + xy: 825, 62 + size: 36, 29 + orig: 36, 29 + offset: 0, 0 + index: -1 +goblingirl/eyes-closed + rotate: false + xy: 59, 6 + size: 37, 15 + orig: 37, 21 + offset: 0, 0 + index: -1 +goblin/eyes-closed + rotate: true + xy: 770, 18 + size: 34, 12 + orig: 34, 12 + offset: 0, 0 + index: -1 diff --git a/spine-sfml/data/goblins.json b/spine-sfml/data/goblins.json index f1dcc96a0..95313ebe6 100644 --- a/spine-sfml/data/goblins.json +++ b/spine-sfml/data/goblins.json @@ -3,26 +3,26 @@ { "name": "root" }, { "name": "hip", "parent": "root", "x": 0.64, "y": 114.41 }, { "name": "left upper leg", "parent": "hip", "length": 50.39, "x": 14.45, "y": 2.81, "rotation": -89.09 }, - { "name": "left lower leg", "parent": "left upper leg", "length": 49.89, "x": 56.34, "y": 0.98, "rotation": -16.65 }, - { "name": "left foot", "parent": "left lower leg", "length": 46.5, "x": 58.94, "y": -7.61, "rotation": 102.43 }, + { "name": "pelvis", "parent": "hip", "x": 1.41, "y": -6.57 }, { "name": "right upper leg", "parent": "hip", "length": 42.45, "x": -20.07, "y": -6.83, "rotation": -97.49 }, - { "name": "right lower leg", "parent": "right upper leg", "length": 58.52, "x": 42.99, "y": -0.61, "rotation": -14.34 }, - { "name": "right foot", "parent": "right lower leg", "length": 45.45, "x": 64.88, "y": 0.04, "rotation": 110.3 }, { "name": "torso", "parent": "hip", "length": 85.82, "x": -6.42, "y": 1.97, "rotation": 93.92 }, - { "name": "neck", "parent": "torso", "length": 18.38, "x": 81.67, "y": -6.34, "rotation": -1.51 }, - { "name": "head", "parent": "neck", "length": 68.28, "x": 20.93, "y": 11.59, "rotation": -13.92 }, - { "name": "right shoulder", "parent": "torso", "length": 37.24, "x": 76.02, "y": 18.14, "rotation": 133.88 }, - { "name": "right arm", "parent": "right shoulder", "length": 36.74, "x": 37.6, "y": 0.31, "rotation": 36.32 }, - { "name": "right hand", "parent": "right arm", "length": 15.32, "x": 36.9, "y": 0.34, "rotation": 2.35 }, + { "name": "left lower leg", "parent": "left upper leg", "length": 49.89, "x": 56.34, "y": 0.98, "rotation": -16.65 }, { "name": "left shoulder", "parent": "torso", "length": 35.43, "x": 74.04, "y": -20.38, "rotation": -156.96 }, + { "name": "neck", "parent": "torso", "length": 18.38, "x": 81.67, "y": -6.34, "rotation": -1.51 }, + { "name": "right lower leg", "parent": "right upper leg", "length": 58.52, "x": 42.99, "y": -0.61, "rotation": -14.34 }, + { "name": "right shoulder", "parent": "torso", "length": 37.24, "x": 76.02, "y": 18.14, "rotation": 133.88 }, + { "name": "head", "parent": "neck", "length": 68.28, "x": 20.93, "y": 11.59, "rotation": -13.92 }, { "name": "left arm", "parent": "left shoulder", "length": 35.62, "x": 37.85, "y": -2.34, "rotation": 28.16 }, + { "name": "left foot", "parent": "left lower leg", "length": 46.5, "x": 58.94, "y": -7.61, "rotation": 102.43 }, + { "name": "right arm", "parent": "right shoulder", "length": 36.74, "x": 37.6, "y": 0.31, "rotation": 36.32 }, + { "name": "right foot", "parent": "right lower leg", "length": 45.45, "x": 64.88, "y": 0.04, "rotation": 110.3 }, { "name": "left hand", "parent": "left arm", "length": 11.52, "x": 35.62, "y": 0.07, "rotation": 2.7 }, - { "name": "pelvis", "parent": "hip", "x": 1.41, "y": -6.57 } + { "name": "right hand", "parent": "right arm", "length": 15.32, "x": 36.9, "y": 0.34, "rotation": 2.35 } ], "slots": [ { "name": "left shoulder", "bone": "left shoulder", "attachment": "left shoulder" }, { "name": "left arm", "bone": "left arm", "attachment": "left arm" }, - { "name": "left hand item", "bone": "left hand", "attachment": "spear" }, + { "name": "left hand item", "bone": "left hand", "attachment": "dagger" }, { "name": "left hand", "bone": "left hand", "attachment": "left hand" }, { "name": "left foot", "bone": "left foot", "attachment": "left foot" }, { "name": "left lower leg", "bone": "left lower leg", "attachment": "left lower leg" }, @@ -45,11 +45,11 @@ "skins": { "default": { "left hand item": { - "dagger": { "x": 7.88, "y": -23.45, "rotation": 10.47, "width": 26, "height": 108 }, + "dagger": { "x": -35.5, "y": 3.85, "rotation": 10.47, "width": 156, "height": 238 }, "spear": { "x": -4.55, "y": 39.2, "rotation": 13.04, "width": 22, "height": 368 } }, "right hand item": { - "dagger": { "x": 6.51, "y": -24.15, "rotation": -8.06, "width": 26, "height": 108 } + "dagger": { "x": -21.57, "y": 15.8, "rotation": -8.06, "width": 156, "height": 238 } } }, "goblin": { diff --git a/spine-sfml/data/goblins.png b/spine-sfml/data/goblins.png index 863b29467..1d6f59e37 100644 Binary files a/spine-sfml/data/goblins.png and b/spine-sfml/data/goblins.png differ diff --git a/spine-sfml/example/main.cpp b/spine-sfml/example/main.cpp index 7e4305a5b..7349d32a6 100644 --- a/spine-sfml/example/main.cpp +++ b/spine-sfml/example/main.cpp @@ -90,6 +90,7 @@ void goblins () { // Load atlas, skeleton, and animations. Atlas* atlas = Atlas_readAtlasFile("../data/goblins.atlas"); SkeletonJson* json = SkeletonJson_create(atlas); + json->scale = 2; SkeletonData *skeletonData = SkeletonJson_readSkeletonDataFile(json, "../data/goblins.json"); Animation* walkAnimation = SkeletonData_findAnimation(skeletonData, "walk"); SkeletonJson_dispose(json); @@ -102,15 +103,15 @@ void goblins () { skeleton->flipY = false; Skeleton_setSkinByName(skeleton, "goblin"); Skeleton_setSlotsToBindPose(skeleton); - Skeleton_setAttachment(skeleton, "left hand item", "dagger"); +// Skeleton_setAttachment(skeleton, "left hand item", "dagger"); skeleton->root->x = 320; - skeleton->root->y = 420; + skeleton->root->y = 590; Skeleton_updateWorldTransform(skeleton); AnimationState_setAnimation(drawable->state, walkAnimation, true); - sf::RenderWindow window(sf::VideoMode(640, 480), "Spine SFML"); + sf::RenderWindow window(sf::VideoMode(640, 640), "Spine SFML"); window.setFramerateLimit(60); sf::Event event; sf::Clock deltaClock; @@ -133,6 +134,6 @@ void goblins () { } int main () { - spineboy(); +// spineboy(); goblins(); } diff --git a/spine-sfml/src/spine/spine-sfml.cpp b/spine-sfml/src/spine/spine-sfml.cpp index c2500bb7a..9b0b473c1 100644 --- a/spine-sfml/src/spine/spine-sfml.cpp +++ b/spine-sfml/src/spine/spine-sfml.cpp @@ -41,7 +41,7 @@ void _AtlasPage_createTexture (AtlasPage* self, const char* path) { self->texture = texture; Vector2u size = texture->getSize(); self->width = size.x; - self->height = size.x; + self->height = size.y; } void _AtlasPage_disposeTexture (AtlasPage* self) { @@ -117,32 +117,19 @@ void SkeletonDrawable::draw (RenderTarget& target, RenderStates states) const { vertices[3].position.x = regionAttachment->vertices[VERTEX_X4]; vertices[3].position.y = regionAttachment->vertices[VERTEX_Y4]; - int u = regionAttachment->region->x; - int u2 = u + regionAttachment->region->width; - int v = regionAttachment->region->y; - int v2 = v + regionAttachment->region->height; - if (regionAttachment->region->rotate) { - vertices[1].texCoords.x = u; - vertices[1].texCoords.y = v2; - vertices[2].texCoords.x = u; - vertices[2].texCoords.y = v; - vertices[3].texCoords.x = u2; - vertices[3].texCoords.y = v; - vertices[0].texCoords.x = u2; - vertices[0].texCoords.y = v2; - } else { - vertices[0].texCoords.x = u; - vertices[0].texCoords.y = v2; - vertices[1].texCoords.x = u; - vertices[1].texCoords.y = v; - vertices[2].texCoords.x = u2; - vertices[2].texCoords.y = v; - vertices[3].texCoords.x = u2; - vertices[3].texCoords.y = v2; - } - // SMFL doesn't handle batching for us, so we'll just force a single texture per skeleton. - states.texture = (Texture*)regionAttachment->region->page->texture; + states.texture = (Texture*)regionAttachment->texture; + + Vector2u size = states.texture->getSize(); + vertices[0].texCoords.x = regionAttachment->uvs[VERTEX_X1] * size.x; + vertices[0].texCoords.y = regionAttachment->uvs[VERTEX_Y1] * size.y; + vertices[1].texCoords.x = regionAttachment->uvs[VERTEX_X2] * size.x; + vertices[1].texCoords.y = regionAttachment->uvs[VERTEX_Y2] * size.y; + vertices[2].texCoords.x = regionAttachment->uvs[VERTEX_X3] * size.x; + vertices[2].texCoords.y = regionAttachment->uvs[VERTEX_Y3] * size.y; + vertices[3].texCoords.x = regionAttachment->uvs[VERTEX_X4] * size.x; + vertices[3].texCoords.y = regionAttachment->uvs[VERTEX_Y4] * size.y; + vertexArray->append(vertices[0]); vertexArray->append(vertices[1]); vertexArray->append(vertices[2]); diff --git a/spine-unity/Assets/Plugins.meta b/spine-unity/Assets/Plugins.meta index 5ff654631..4e038029f 100644 --- a/spine-unity/Assets/Plugins.meta +++ b/spine-unity/Assets/Plugins.meta @@ -1,4 +1,2 @@ fileFormatVersion: 2 guid: 89dad76e10ea944ee9f29109535294be -DefaultImporter: - userData: diff --git a/spine-unity/Assets/Plugins/Editor.meta b/spine-unity/Assets/Plugins/Editor.meta index a7344dfce..7e1e98c44 100644 --- a/spine-unity/Assets/Plugins/Editor.meta +++ b/spine-unity/Assets/Plugins/Editor.meta @@ -1,4 +1,2 @@ fileFormatVersion: 2 guid: 65ba3309ea8c447678ade95f3fa398da -DefaultImporter: - userData: diff --git a/spine-unity/Assets/Plugins/Editor/Spine.meta b/spine-unity/Assets/Plugins/Editor/Spine.meta index 3078e89c1..4ab6e3357 100644 --- a/spine-unity/Assets/Plugins/Editor/Spine.meta +++ b/spine-unity/Assets/Plugins/Editor/Spine.meta @@ -1,4 +1,2 @@ fileFormatVersion: 2 guid: 3ac78ae082927411cba77d73efde27d4 -DefaultImporter: - userData: diff --git a/spine-unity/Assets/Plugins/Editor/Spine/AtlasAssetInspector.cs.meta b/spine-unity/Assets/Plugins/Editor/Spine/AtlasAssetInspector.cs.meta index 898e53399..3cfa801af 100644 --- a/spine-unity/Assets/Plugins/Editor/Spine/AtlasAssetInspector.cs.meta +++ b/spine-unity/Assets/Plugins/Editor/Spine/AtlasAssetInspector.cs.meta @@ -5,4 +5,3 @@ MonoImporter: defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} - userData: diff --git a/spine-unity/Assets/Plugins/Editor/Spine/Menus.cs.meta b/spine-unity/Assets/Plugins/Editor/Spine/Menus.cs.meta index ab58e94aa..22ca2a8c0 100644 --- a/spine-unity/Assets/Plugins/Editor/Spine/Menus.cs.meta +++ b/spine-unity/Assets/Plugins/Editor/Spine/Menus.cs.meta @@ -5,4 +5,3 @@ MonoImporter: defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} - userData: diff --git a/spine-unity/Assets/Plugins/Editor/Spine/SkeletonComponentInspector.cs b/spine-unity/Assets/Plugins/Editor/Spine/SkeletonComponentInspector.cs index 80c43e3a2..ab089d0a6 100644 --- a/spine-unity/Assets/Plugins/Editor/Spine/SkeletonComponentInspector.cs +++ b/spine-unity/Assets/Plugins/Editor/Spine/SkeletonComponentInspector.cs @@ -29,10 +29,11 @@ using UnityEngine; [CustomEditor(typeof(SkeletonComponent))] public class SkeletonComponentInspector : Editor { - private SerializedProperty skeletonDataAsset, animationName, loop, timeScale; + private SerializedProperty skeletonDataAsset, animationName, skinName, loop, timeScale; void OnEnable () { skeletonDataAsset = serializedObject.FindProperty("skeletonDataAsset"); + skinName = serializedObject.FindProperty("skinName"); animationName = serializedObject.FindProperty("animationName"); loop = serializedObject.FindProperty("loop"); timeScale = serializedObject.FindProperty("timeScale"); @@ -46,6 +47,24 @@ public class SkeletonComponentInspector : Editor { EditorGUILayout.PropertyField(skeletonDataAsset); if (component.skeleton != null) { + // Skin name. + String[] skins = new String[component.skeleton.Data.Skins.Count + 1]; + int skinIndex = 0; + for (int i = 0; i < skins.Length - 1; i++) { + String name = component.skeleton.Data.Skins[i].Name; + skins[i] = name; + if (name == skinName.stringValue) skinIndex = i; + } + + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.LabelField("Skin"); + EditorGUIUtility.LookLikeControls(); + skinIndex = EditorGUILayout.Popup(skinIndex, skins); + EditorGUIUtility.LookLikeInspector(); + EditorGUILayout.EndHorizontal(); + + skinName.stringValue = skinIndex == 0 ? null : skins[skinIndex]; + // Animation name. String[] animations = new String[component.skeleton.Data.Animations.Count + 1]; animations[0] = ""; @@ -53,8 +72,7 @@ public class SkeletonComponentInspector : Editor { for (int i = 0; i < animations.Length - 1; i++) { String name = component.skeleton.Data.Animations[i].Name; animations[i + 1] = name; - if (name == animationName.stringValue) - animationIndex = i + 1; + if (name == animationName.stringValue) animationIndex = i + 1; } EditorGUILayout.BeginHorizontal(); @@ -75,10 +93,10 @@ public class SkeletonComponentInspector : Editor { EditorGUILayout.PropertyField(timeScale); - if (!Application.isPlaying) { - if (serializedObject.ApplyModifiedProperties() || - (Event.current.type == EventType.ValidateCommand && Event.current.commandName == "UndoRedoPerformed") - ) { + if (serializedObject.ApplyModifiedProperties() || + (Event.current.type == EventType.ValidateCommand && Event.current.commandName == "UndoRedoPerformed") + ) { + if (!Application.isPlaying) { component.Clear(); component.Update(); } diff --git a/spine-unity/Assets/Plugins/Editor/Spine/SkeletonComponentInspector.cs.meta b/spine-unity/Assets/Plugins/Editor/Spine/SkeletonComponentInspector.cs.meta index 1d38c4c42..054df3e06 100644 --- a/spine-unity/Assets/Plugins/Editor/Spine/SkeletonComponentInspector.cs.meta +++ b/spine-unity/Assets/Plugins/Editor/Spine/SkeletonComponentInspector.cs.meta @@ -5,4 +5,3 @@ MonoImporter: defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} - userData: diff --git a/spine-unity/Assets/Plugins/Editor/Spine/SkeletonDataAssetInspector.cs.meta b/spine-unity/Assets/Plugins/Editor/Spine/SkeletonDataAssetInspector.cs.meta index fba64b6e3..28721a69b 100644 --- a/spine-unity/Assets/Plugins/Editor/Spine/SkeletonDataAssetInspector.cs.meta +++ b/spine-unity/Assets/Plugins/Editor/Spine/SkeletonDataAssetInspector.cs.meta @@ -5,4 +5,3 @@ MonoImporter: defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} - userData: diff --git a/spine-unity/Assets/Plugins/Spine.meta b/spine-unity/Assets/Plugins/Spine.meta index b0d5f2364..1cf97fd10 100644 --- a/spine-unity/Assets/Plugins/Spine.meta +++ b/spine-unity/Assets/Plugins/Spine.meta @@ -1,4 +1,2 @@ fileFormatVersion: 2 guid: c6674329008ae4c65a7b7e8f1b2a6523 -DefaultImporter: - userData: diff --git a/spine-unity/Assets/Plugins/Spine/AtlasAsset.cs.meta b/spine-unity/Assets/Plugins/Spine/AtlasAsset.cs.meta index 8cd9bc105..d9d83b0fa 100644 --- a/spine-unity/Assets/Plugins/Spine/AtlasAsset.cs.meta +++ b/spine-unity/Assets/Plugins/Spine/AtlasAsset.cs.meta @@ -5,4 +5,3 @@ MonoImporter: defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} - userData: diff --git a/spine-unity/Assets/Plugins/Spine/SkeletonComponent.cs b/spine-unity/Assets/Plugins/Spine/SkeletonComponent.cs index 63c88bf59..55b3981eb 100644 --- a/spine-unity/Assets/Plugins/Spine/SkeletonComponent.cs +++ b/spine-unity/Assets/Plugins/Spine/SkeletonComponent.cs @@ -32,12 +32,14 @@ using Spine; public class SkeletonComponent : MonoBehaviour { public SkeletonDataAsset skeletonDataAsset; public Skeleton skeleton; + public String skinName; public String animationName; public bool loop; public float timeScale = 1; public Spine.AnimationState state; private Mesh mesh; private Vector3[] vertices; + private Color[] colors; private Vector2[] uvs; private int[] triangles; private int quadCount; @@ -80,15 +82,26 @@ public class SkeletonComponent : MonoBehaviour { Initialize(); // Keep AnimationState in sync with animationName and loop fields. - if (animationName == null && state.Animation != null) - state.ClearAnimation(); - else if (state.Animation == null || animationName != state.Animation.Name) { + if (animationName == null || animationName.Length == 0) { + if (state.Animation != null) state.ClearAnimation(); + } else if (state.Animation == null || animationName != state.Animation.Name) { Spine.Animation animation = skeleton.Data.FindAnimation(animationName); if (animation != null) state.SetAnimation(animation, loop); } state.Loop = loop; + // Keep Skeleton in sync with skinName. + if (skinName == null || skinName.Length == 0) { + if (skeleton.Skin != null) { + skeleton.SetSkin((Skin)null); + skeleton.SetSlotsToBindPose(); + } + } else if (skeleton.Skin == null || skinName != skeleton.Skin.Name) { + skeleton.SetSkin(skinName); + skeleton.SetSlotsToBindPose(); + } + UpdateAnimation(); // Count quads. @@ -105,12 +118,15 @@ public class SkeletonComponent : MonoBehaviour { if (quadCount != this.quadCount) { this.quadCount = quadCount; vertices = new Vector3[quadCount * 4]; + colors = new Color[quadCount * 4]; uvs = new Vector2[quadCount * 4]; triangles = new int[quadCount * 6]; + mesh.Clear(); } // Setup mesh. int quadIndex = 0; + Color color = new Color(); for (int i = 0, n = drawOrder.Count; i < n; i++) { Slot slot = drawOrder[i]; Attachment attachment = slot.Attachment; @@ -125,18 +141,20 @@ public class SkeletonComponent : MonoBehaviour { vertices[vertexIndex + 2] = new Vector3(regionVertices[RegionAttachment.X2], regionVertices[RegionAttachment.Y2], 0); vertices[vertexIndex + 3] = new Vector3(regionVertices[RegionAttachment.X3], regionVertices[RegionAttachment.Y3], 0); - AtlasRegion region = regionAttachment.Region; - if (region.rotate) { - uvs[vertexIndex + 1] = new Vector2(region.u, 1 - region.v2); - uvs[vertexIndex + 2] = new Vector2(region.u2, 1 - region.v2); - uvs[vertexIndex + 3] = new Vector2(region.u, 1 - region.v); - uvs[vertexIndex] = new Vector2(region.u2, 1 - region.v); - } else { - uvs[vertexIndex] = new Vector2(region.u, 1 - region.v2); - uvs[vertexIndex + 1] = new Vector2(region.u2, 1 - region.v2); - uvs[vertexIndex + 2] = new Vector2(region.u, 1 - region.v); - uvs[vertexIndex + 3] = new Vector2(region.u2, 1 - region.v); - } + color.r = skeleton.R * slot.R; + color.g = skeleton.G * slot.G; + color.b = skeleton.B * slot.B; + color.a = skeleton.A * slot.A; + colors[vertexIndex] = color; + colors[vertexIndex + 1] = color; + colors[vertexIndex + 2] = color; + colors[vertexIndex + 3] = color; + + float[] regionUVs = regionAttachment.UVs; + uvs[vertexIndex] = new Vector2(regionUVs[RegionAttachment.X1], 1 - regionUVs[RegionAttachment.Y1]); + uvs[vertexIndex + 1] = new Vector2(regionUVs[RegionAttachment.X4], 1 - regionUVs[RegionAttachment.Y4]); + uvs[vertexIndex + 2] = new Vector2(regionUVs[RegionAttachment.X2], 1 - regionUVs[RegionAttachment.Y2]); + uvs[vertexIndex + 3] = new Vector2(regionUVs[RegionAttachment.X3], 1 - regionUVs[RegionAttachment.Y3]); int index = quadIndex * 6; triangles[index] = vertexIndex; @@ -150,6 +168,7 @@ public class SkeletonComponent : MonoBehaviour { } } mesh.vertices = vertices; + mesh.colors = colors; mesh.uv = uvs; mesh.triangles = triangles; diff --git a/spine-unity/Assets/Plugins/Spine/SkeletonComponent.cs.meta b/spine-unity/Assets/Plugins/Spine/SkeletonComponent.cs.meta index 255c3fe77..521498e33 100644 --- a/spine-unity/Assets/Plugins/Spine/SkeletonComponent.cs.meta +++ b/spine-unity/Assets/Plugins/Spine/SkeletonComponent.cs.meta @@ -5,4 +5,3 @@ MonoImporter: defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} - userData: diff --git a/spine-unity/Assets/Plugins/Spine/SkeletonDataAsset.cs.meta b/spine-unity/Assets/Plugins/Spine/SkeletonDataAsset.cs.meta index db4f247d4..3e2c4a140 100644 --- a/spine-unity/Assets/Plugins/Spine/SkeletonDataAsset.cs.meta +++ b/spine-unity/Assets/Plugins/Spine/SkeletonDataAsset.cs.meta @@ -5,4 +5,3 @@ MonoImporter: defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} - userData: diff --git a/spine-unity/Assets/Plugins/Spine/spine-csharp.meta b/spine-unity/Assets/Plugins/Spine/spine-csharp.meta index 358038ce9..86f8e1a90 100644 --- a/spine-unity/Assets/Plugins/Spine/spine-csharp.meta +++ b/spine-unity/Assets/Plugins/Spine/spine-csharp.meta @@ -1,4 +1,2 @@ fileFormatVersion: 2 guid: 1b62d1da83172ed4f9bfc9077b196f79 -DefaultImporter: - userData: diff --git a/spine-unity/Assets/Plugins/Spine/spine-csharp/Animation.cs.meta b/spine-unity/Assets/Plugins/Spine/spine-csharp/Animation.cs.meta new file mode 100644 index 000000000..a6f0e5341 --- /dev/null +++ b/spine-unity/Assets/Plugins/Spine/spine-csharp/Animation.cs.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0420fbdc5d996d142a6850f8bc69b789 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} diff --git a/spine-unity/Assets/Plugins/Spine/spine-csharp/AnimationState.cs.meta b/spine-unity/Assets/Plugins/Spine/spine-csharp/AnimationState.cs.meta new file mode 100644 index 000000000..0ba167b21 --- /dev/null +++ b/spine-unity/Assets/Plugins/Spine/spine-csharp/AnimationState.cs.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 04676fb0853784d40a83ea746566d7d9 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} diff --git a/spine-unity/Assets/Plugins/Spine/spine-csharp/AnimationStateData.cs.meta b/spine-unity/Assets/Plugins/Spine/spine-csharp/AnimationStateData.cs.meta new file mode 100644 index 000000000..f49f5b4bb --- /dev/null +++ b/spine-unity/Assets/Plugins/Spine/spine-csharp/AnimationStateData.cs.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f053f134e4ff2fe489038eabf85706e2 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} diff --git a/spine-unity/Assets/Plugins/Spine/spine-csharp/Atlas.cs b/spine-unity/Assets/Plugins/Spine/spine-csharp/Atlas.cs index 421668136..1951533c0 100644 --- a/spine-unity/Assets/Plugins/Spine/spine-csharp/Atlas.cs +++ b/spine-unity/Assets/Plugins/Spine/spine-csharp/Atlas.cs @@ -98,8 +98,13 @@ namespace Spine { region.u = x / (float)page.width; region.v = y / (float)page.height; - region.u2 = (x + width) / (float)page.width; - region.v2 = (y + height) / (float)page.height; + if (region.rotate) { + region.u2 = (x + height) / (float)page.width; + region.v2 = (y + width) / (float)page.height; + } else { + region.u2 = (x + width) / (float)page.width; + region.v2 = (y + height) / (float)page.height; + } region.x = x; region.y = y; region.width = Math.Abs(width); diff --git a/spine-unity/Assets/Plugins/Spine/spine-csharp/Atlas.cs.meta b/spine-unity/Assets/Plugins/Spine/spine-csharp/Atlas.cs.meta new file mode 100644 index 000000000..4b92ab505 --- /dev/null +++ b/spine-unity/Assets/Plugins/Spine/spine-csharp/Atlas.cs.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 6e3ac7a5e853f8c418686b97eb793a49 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} diff --git a/spine-unity/Assets/Plugins/Spine/spine-csharp/Attachments.meta b/spine-unity/Assets/Plugins/Spine/spine-csharp/Attachments.meta new file mode 100644 index 000000000..bead1a5f4 --- /dev/null +++ b/spine-unity/Assets/Plugins/Spine/spine-csharp/Attachments.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: eca0339f92705724385840be789d03e3 diff --git a/spine-unity/Assets/Plugins/Spine/spine-csharp/Attachments/AtlasAttachmentLoader.cs b/spine-unity/Assets/Plugins/Spine/spine-csharp/Attachments/AtlasAttachmentLoader.cs index 28f44658f..b2749d7b3 100644 --- a/spine-unity/Assets/Plugins/Spine/spine-csharp/Attachments/AtlasAttachmentLoader.cs +++ b/spine-unity/Assets/Plugins/Spine/spine-csharp/Attachments/AtlasAttachmentLoader.cs @@ -40,7 +40,14 @@ namespace Spine { AtlasRegion region = atlas.FindRegion(name); if (region == null) throw new Exception("Region not found in atlas: " + name + " (" + type + ")"); RegionAttachment attachment = new RegionAttachment(name); - attachment.Region = region; + attachment.Texture = region.page.texture; + attachment.SetUVs(region.u, region.v, region.u2, region.v2, region.rotate); + attachment.RegionOffsetX = region.offsetX; + attachment.RegionOffsetY = region.offsetY; + attachment.RegionWidth = region.width; + attachment.RegionHeight = region.height; + attachment.RegionOriginalWidth = region.originalWidth; + attachment.RegionOriginalHeight = region.originalHeight; return attachment; } throw new Exception("Unknown attachment type: " + type); diff --git a/spine-unity/Assets/Plugins/Spine/spine-csharp/Attachments/AtlasAttachmentLoader.cs.meta b/spine-unity/Assets/Plugins/Spine/spine-csharp/Attachments/AtlasAttachmentLoader.cs.meta new file mode 100644 index 000000000..f273aaa7a --- /dev/null +++ b/spine-unity/Assets/Plugins/Spine/spine-csharp/Attachments/AtlasAttachmentLoader.cs.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0c1ff82f1740b034480656d1ea5ba5c9 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} diff --git a/spine-unity/Assets/Plugins/Spine/spine-csharp/Attachments/Attachment.cs.meta b/spine-unity/Assets/Plugins/Spine/spine-csharp/Attachments/Attachment.cs.meta new file mode 100644 index 000000000..b2bba42ed --- /dev/null +++ b/spine-unity/Assets/Plugins/Spine/spine-csharp/Attachments/Attachment.cs.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3a9d34b8d423e46439ed489f9088a81a +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} diff --git a/spine-unity/Assets/Plugins/Spine/spine-csharp/Attachments/AttachmentLoader.cs.meta b/spine-unity/Assets/Plugins/Spine/spine-csharp/Attachments/AttachmentLoader.cs.meta new file mode 100644 index 000000000..00eb55bc3 --- /dev/null +++ b/spine-unity/Assets/Plugins/Spine/spine-csharp/Attachments/AttachmentLoader.cs.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d55032acb28c73c4287a3a500e318215 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} diff --git a/spine-unity/Assets/Plugins/Spine/spine-csharp/Attachments/AttachmentType.cs.meta b/spine-unity/Assets/Plugins/Spine/spine-csharp/Attachments/AttachmentType.cs.meta new file mode 100644 index 000000000..80df16240 --- /dev/null +++ b/spine-unity/Assets/Plugins/Spine/spine-csharp/Attachments/AttachmentType.cs.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: b8cd583653fbdab46a2ed87a0eb729d3 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} diff --git a/spine-unity/Assets/Plugins/Spine/spine-csharp/Attachments/RegionAttachment.cs b/spine-unity/Assets/Plugins/Spine/spine-csharp/Attachments/RegionAttachment.cs index 11a7cf95e..445f1e2ed 100644 --- a/spine-unity/Assets/Plugins/Spine/spine-csharp/Attachments/RegionAttachment.cs +++ b/spine-unity/Assets/Plugins/Spine/spine-csharp/Attachments/RegionAttachment.cs @@ -45,45 +45,61 @@ namespace Spine { public float Width { get; set; } public float Height { get; set; } + public Object Texture { get; set; } + public float RegionOffsetX { get; set; } + public float RegionOffsetY { get; set; } // Pixels stripped from the bottom left, unrotated. + public float RegionWidth { get; set; } + public float RegionHeight { get; set; } // Unrotated, stripped size. + public float RegionOriginalWidth { get; set; } + public float RegionOriginalHeight { get; set; } // Unrotated, unstripped size. + public float[] Offset { get; private set; } public float[] Vertices { get; private set; } - public AtlasRegion Region { get; set; } + public float[] UVs { get; private set; } public RegionAttachment (string name) : base(name) { Offset = new float[8]; Vertices = new float[8]; + UVs = new float[8]; ScaleX = 1; ScaleY = 1; } + public void SetUVs (float u, float v, float u2, float v2, bool rotate) { + float[] uvs = UVs; + if (rotate) { + uvs[X2] = u; + uvs[Y2] = v2; + uvs[X3] = u; + uvs[Y3] = v; + uvs[X4] = u2; + uvs[Y4] = v; + uvs[X1] = u2; + uvs[Y1] = v2; + } else { + uvs[X1] = u; + uvs[Y1] = v2; + uvs[X2] = u; + uvs[Y2] = v; + uvs[X3] = u2; + uvs[Y3] = v; + uvs[X4] = u2; + uvs[Y4] = v2; + } + } + public void UpdateOffset () { float width = Width; float height = Height; - float localX2 = width / 2; - float localY2 = height / 2; - float localX = -localX2; - float localY = -localY2; - AtlasRegion region = Region; - if (region != null) { - if (region.rotate) { - localX += region.offsetX / region.originalWidth * height; - localY += region.offsetY / region.originalHeight * width; - localX2 -= (region.originalWidth - region.offsetX - region.height) / region.originalWidth * width; - localY2 -= (region.originalHeight - region.offsetY - region.width) / region.originalHeight * height; - } else { - localX += region.offsetX / region.originalWidth * width; - localY += region.offsetY / region.originalHeight * height; - localX2 -= (region.originalWidth - region.offsetX - region.width) / region.originalWidth * width; - localY2 -= (region.originalHeight - region.offsetY - region.height) / region.originalHeight * height; - } - } float scaleX = ScaleX; float scaleY = ScaleY; - localX *= scaleX; - localY *= scaleY; - localX2 *= scaleX; - localY2 *= scaleY; + float regionScaleX = width / RegionOriginalWidth * scaleX; + float regionScaleY = height / RegionOriginalHeight * scaleY; + float localX = -width / 2 * scaleX + RegionOffsetX * regionScaleX; + float localY = -height / 2 * scaleY + RegionOffsetY * regionScaleY; + float localX2 = localX + RegionWidth * regionScaleX; + float localY2 = localY + RegionHeight * regionScaleY; float radians = Rotation * (float)Math.PI / 180; float cos = (float)Math.Cos(radians); float sin = (float)Math.Sin(radians); diff --git a/spine-unity/Assets/Plugins/Spine/spine-csharp/Attachments/RegionAttachment.cs.meta b/spine-unity/Assets/Plugins/Spine/spine-csharp/Attachments/RegionAttachment.cs.meta new file mode 100644 index 000000000..ca7ef9861 --- /dev/null +++ b/spine-unity/Assets/Plugins/Spine/spine-csharp/Attachments/RegionAttachment.cs.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: cf530751ed6f2d94684dd5d3f0a46b32 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} diff --git a/spine-unity/Assets/Plugins/Spine/spine-csharp/Bone.cs.meta b/spine-unity/Assets/Plugins/Spine/spine-csharp/Bone.cs.meta new file mode 100644 index 000000000..0c4e94614 --- /dev/null +++ b/spine-unity/Assets/Plugins/Spine/spine-csharp/Bone.cs.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9ac20594bc8a0214bacc799c1a24584b +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} diff --git a/spine-unity/Assets/Plugins/Spine/spine-csharp/BoneData.cs.meta b/spine-unity/Assets/Plugins/Spine/spine-csharp/BoneData.cs.meta new file mode 100644 index 000000000..7da26e601 --- /dev/null +++ b/spine-unity/Assets/Plugins/Spine/spine-csharp/BoneData.cs.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 40e05d62889ff8f49a201a4207075ab7 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} diff --git a/spine-unity/Assets/Plugins/Spine/spine-csharp/Json.cs.meta b/spine-unity/Assets/Plugins/Spine/spine-csharp/Json.cs.meta new file mode 100644 index 000000000..f3884884b --- /dev/null +++ b/spine-unity/Assets/Plugins/Spine/spine-csharp/Json.cs.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 543c95fda2aa74849b8bd90a810318a7 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} diff --git a/spine-unity/Assets/Plugins/Spine/spine-csharp/Skeleton.cs.meta b/spine-unity/Assets/Plugins/Spine/spine-csharp/Skeleton.cs.meta new file mode 100644 index 000000000..c235c40c5 --- /dev/null +++ b/spine-unity/Assets/Plugins/Spine/spine-csharp/Skeleton.cs.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c3d73fa94450faf4eb0073fa19e30a62 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} diff --git a/spine-unity/Assets/Plugins/Spine/spine-csharp/SkeletonData.cs.meta b/spine-unity/Assets/Plugins/Spine/spine-csharp/SkeletonData.cs.meta new file mode 100644 index 000000000..f88baa1bb --- /dev/null +++ b/spine-unity/Assets/Plugins/Spine/spine-csharp/SkeletonData.cs.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: db93a39a328e01d479bcd2820c7b1137 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} diff --git a/spine-unity/Assets/Plugins/Spine/spine-csharp/SkeletonJson.cs.meta b/spine-unity/Assets/Plugins/Spine/spine-csharp/SkeletonJson.cs.meta new file mode 100644 index 000000000..576e7470b --- /dev/null +++ b/spine-unity/Assets/Plugins/Spine/spine-csharp/SkeletonJson.cs.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: db9e0e85729911e4c9d3ca5638cd016d +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} diff --git a/spine-unity/Assets/Plugins/Spine/spine-csharp/Skin.cs.meta b/spine-unity/Assets/Plugins/Spine/spine-csharp/Skin.cs.meta new file mode 100644 index 000000000..7db97b6e4 --- /dev/null +++ b/spine-unity/Assets/Plugins/Spine/spine-csharp/Skin.cs.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3a8af7042d0b3f54cbae97de4504bab7 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} diff --git a/spine-unity/Assets/Plugins/Spine/spine-csharp/Slot.cs.meta b/spine-unity/Assets/Plugins/Spine/spine-csharp/Slot.cs.meta new file mode 100644 index 000000000..2f5800c73 --- /dev/null +++ b/spine-unity/Assets/Plugins/Spine/spine-csharp/Slot.cs.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 6486acd3c3094b44288f9fc6666aaf65 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} diff --git a/spine-unity/Assets/Plugins/Spine/spine-csharp/SlotData.cs.meta b/spine-unity/Assets/Plugins/Spine/spine-csharp/SlotData.cs.meta new file mode 100644 index 000000000..febdd0893 --- /dev/null +++ b/spine-unity/Assets/Plugins/Spine/spine-csharp/SlotData.cs.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: ea1befda235c3cf429acd2a0b095e74b +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} diff --git a/spine-unity/Assets/Shaders.meta b/spine-unity/Assets/Shaders.meta index 445001627..c62ca6925 100644 --- a/spine-unity/Assets/Shaders.meta +++ b/spine-unity/Assets/Shaders.meta @@ -1,4 +1,2 @@ fileFormatVersion: 2 guid: b41395738f68d4fbba8311d333db62b1 -DefaultImporter: - userData: diff --git a/spine-unity/Assets/Shaders/Skeleton.shader b/spine-unity/Assets/Shaders/Skeleton.shader index b9008410b..833421cb4 100644 --- a/spine-unity/Assets/Shaders/Skeleton.shader +++ b/spine-unity/Assets/Shaders/Skeleton.shader @@ -9,8 +9,9 @@ Shader "Skeleton" { ZWrite Off Blend One OneMinusSrcAlpha Pass { + ColorMaterial AmbientAndDiffuse SetTexture [_MainTex] { - combine texture + combine texture * primary } } } diff --git a/spine-unity/Assets/Shaders/Skeleton.shader.meta b/spine-unity/Assets/Shaders/Skeleton.shader.meta index ffa3725ad..cf8d89ac9 100644 --- a/spine-unity/Assets/Shaders/Skeleton.shader.meta +++ b/spine-unity/Assets/Shaders/Skeleton.shader.meta @@ -1,4 +1,2 @@ fileFormatVersion: 2 guid: 1e8a610c9e01c3648bac42585e5fc676 -ShaderImporter: - userData: diff --git a/spine-unity/Assets/examples.meta b/spine-unity/Assets/examples.meta index 8047acbfe..0728f1da1 100644 --- a/spine-unity/Assets/examples.meta +++ b/spine-unity/Assets/examples.meta @@ -1,4 +1,2 @@ fileFormatVersion: 2 guid: e6712a5a0c05f9f4092f9a3197925e99 -DefaultImporter: - userData: diff --git a/spine-unity/Assets/examples/Unity 3.5.meta b/spine-unity/Assets/examples/Unity 3.5.meta new file mode 100644 index 000000000..4134d9b0f --- /dev/null +++ b/spine-unity/Assets/examples/Unity 3.5.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 97269dddd903cfd469a75f320a0cef8f diff --git a/spine-unity/Assets/examples/Unity 3.5/goblins.meta b/spine-unity/Assets/examples/Unity 3.5/goblins.meta new file mode 100644 index 000000000..65cadc94c --- /dev/null +++ b/spine-unity/Assets/examples/Unity 3.5/goblins.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 4e70126bb9873e841b4935b7275730cc diff --git a/spine-unity/Assets/examples/Unity 3.5/goblins/goblins Atlas.asset b/spine-unity/Assets/examples/Unity 3.5/goblins/goblins Atlas.asset new file mode 100644 index 000000000..06aa0602d Binary files /dev/null and b/spine-unity/Assets/examples/Unity 3.5/goblins/goblins Atlas.asset differ diff --git a/spine-unity/Assets/examples/Unity 3.5/goblins/goblins Atlas.asset.meta b/spine-unity/Assets/examples/Unity 3.5/goblins/goblins Atlas.asset.meta new file mode 100644 index 000000000..aef55af76 --- /dev/null +++ b/spine-unity/Assets/examples/Unity 3.5/goblins/goblins Atlas.asset.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 618309bc7071d724ca2dbfd70e14feef diff --git a/spine-unity/Assets/examples/Unity 3.5/goblins/goblins Skeleton Data.asset b/spine-unity/Assets/examples/Unity 3.5/goblins/goblins Skeleton Data.asset new file mode 100644 index 000000000..5e9c37199 Binary files /dev/null and b/spine-unity/Assets/examples/Unity 3.5/goblins/goblins Skeleton Data.asset differ diff --git a/spine-unity/Assets/examples/Unity 3.5/goblins/goblins Skeleton Data.asset.meta b/spine-unity/Assets/examples/Unity 3.5/goblins/goblins Skeleton Data.asset.meta new file mode 100644 index 000000000..d4f3d167c --- /dev/null +++ b/spine-unity/Assets/examples/Unity 3.5/goblins/goblins Skeleton Data.asset.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 78ac5e44b15e8a7418ea5313951ea050 diff --git a/spine-unity/Assets/examples/Unity 3.5/goblins/goblins.mat b/spine-unity/Assets/examples/Unity 3.5/goblins/goblins.mat new file mode 100644 index 000000000..24b7062a1 Binary files /dev/null and b/spine-unity/Assets/examples/Unity 3.5/goblins/goblins.mat differ diff --git a/spine-unity/Assets/examples/Unity 3.5/goblins/goblins.mat.meta b/spine-unity/Assets/examples/Unity 3.5/goblins/goblins.mat.meta new file mode 100644 index 000000000..32417a746 --- /dev/null +++ b/spine-unity/Assets/examples/Unity 3.5/goblins/goblins.mat.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 3f474a0bd32d8d448afdbe538067b5a7 diff --git a/spine-unity/Assets/examples/Unity 3.5/goblins/goblins.unity b/spine-unity/Assets/examples/Unity 3.5/goblins/goblins.unity new file mode 100644 index 000000000..fbcf75b32 Binary files /dev/null and b/spine-unity/Assets/examples/Unity 3.5/goblins/goblins.unity differ diff --git a/spine-unity/Assets/examples/Unity 3.5/goblins/goblins.unity.meta b/spine-unity/Assets/examples/Unity 3.5/goblins/goblins.unity.meta new file mode 100644 index 000000000..ca8387942 --- /dev/null +++ b/spine-unity/Assets/examples/Unity 3.5/goblins/goblins.unity.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: a8b1d5a7e1dcd0e42aee4a2ec763e0d0 diff --git a/spine-unity/Assets/examples/Unity 4.meta b/spine-unity/Assets/examples/Unity 4.meta new file mode 100644 index 000000000..82b87fa21 --- /dev/null +++ b/spine-unity/Assets/examples/Unity 4.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: c42e48410176c3b43ac8ba8fbb1256d2 +DefaultImporter: + userData: diff --git a/spine-unity/Assets/examples/Unity 4/goblins.meta b/spine-unity/Assets/examples/Unity 4/goblins.meta new file mode 100644 index 000000000..38300ba18 --- /dev/null +++ b/spine-unity/Assets/examples/Unity 4/goblins.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: 6982507deb28dc243803f492193a3d7f +DefaultImporter: + userData: diff --git a/spine-unity/Assets/examples/Unity 4/goblins/goblins Atlas.asset b/spine-unity/Assets/examples/Unity 4/goblins/goblins Atlas.asset new file mode 100644 index 000000000..715d13d18 Binary files /dev/null and b/spine-unity/Assets/examples/Unity 4/goblins/goblins Atlas.asset differ diff --git a/spine-unity/Assets/examples/Unity 4/goblins/goblins Atlas.asset.meta b/spine-unity/Assets/examples/Unity 4/goblins/goblins Atlas.asset.meta new file mode 100644 index 000000000..fd068b60e --- /dev/null +++ b/spine-unity/Assets/examples/Unity 4/goblins/goblins Atlas.asset.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: fc3c1868caff80847bef02256afc1929 +NativeFormatImporter: + userData: diff --git a/spine-unity/Assets/examples/Unity 4/goblins/goblins Material.mat b/spine-unity/Assets/examples/Unity 4/goblins/goblins Material.mat new file mode 100644 index 000000000..0e4186dcb Binary files /dev/null and b/spine-unity/Assets/examples/Unity 4/goblins/goblins Material.mat differ diff --git a/spine-unity/Assets/examples/Unity 4/goblins/goblins Material.mat.meta b/spine-unity/Assets/examples/Unity 4/goblins/goblins Material.mat.meta new file mode 100644 index 000000000..c844af8b2 --- /dev/null +++ b/spine-unity/Assets/examples/Unity 4/goblins/goblins Material.mat.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: 03bd08e6a86550d43862ec7c8d3299fa +NativeFormatImporter: + userData: diff --git a/spine-unity/Assets/examples/Unity 4/goblins/goblins Skeleton Data.asset b/spine-unity/Assets/examples/Unity 4/goblins/goblins Skeleton Data.asset new file mode 100644 index 000000000..d09a45f37 Binary files /dev/null and b/spine-unity/Assets/examples/Unity 4/goblins/goblins Skeleton Data.asset differ diff --git a/spine-unity/Assets/examples/Unity 4/goblins/goblins Skeleton Data.asset.meta b/spine-unity/Assets/examples/Unity 4/goblins/goblins Skeleton Data.asset.meta new file mode 100644 index 000000000..82bc7db4f --- /dev/null +++ b/spine-unity/Assets/examples/Unity 4/goblins/goblins Skeleton Data.asset.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: 6cc4b79878746da48a07ee8a3e0539f8 +NativeFormatImporter: + userData: diff --git a/spine-unity/Assets/examples/Unity 4/goblins/goblins.unity b/spine-unity/Assets/examples/Unity 4/goblins/goblins.unity new file mode 100644 index 000000000..fb21377b2 Binary files /dev/null and b/spine-unity/Assets/examples/Unity 4/goblins/goblins.unity differ diff --git a/spine-unity/Assets/examples/Unity 4/goblins/goblins.unity.meta b/spine-unity/Assets/examples/Unity 4/goblins/goblins.unity.meta new file mode 100644 index 000000000..a0fb306db --- /dev/null +++ b/spine-unity/Assets/examples/Unity 4/goblins/goblins.unity.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: b82102ea5922f7c4d814eef0895967ca +DefaultImporter: + userData: diff --git a/spine-unity/Assets/examples/data.meta b/spine-unity/Assets/examples/data.meta index ffd34f62d..580138f9f 100644 --- a/spine-unity/Assets/examples/data.meta +++ b/spine-unity/Assets/examples/data.meta @@ -1,4 +1,2 @@ fileFormatVersion: 2 guid: 63d11713f97bfe54bb06572e24050ecb -DefaultImporter: - userData: diff --git a/spine-unity/Assets/examples/data/goblins.atlas.txt b/spine-unity/Assets/examples/data/goblins.atlas.txt index c69e342fd..ce74602e5 100644 --- a/spine-unity/Assets/examples/data/goblins.atlas.txt +++ b/spine-unity/Assets/examples/data/goblins.atlas.txt @@ -3,283 +3,283 @@ goblins.png format: RGBA8888 filter: Linear,Linear repeat: none -images/spear - rotate: false - xy: 2, 142 +spear + rotate: true + xy: 2, 104 size: 22, 368 orig: 22, 368 offset: 0, 0 index: -1 -images/goblingirl/head +goblingirl/head rotate: false - xy: 26, 429 - size: 103, 81 + xy: 2, 23 + size: 103, 79 orig: 103, 81 - offset: 0, 0 + offset: 0, 2 index: -1 -images/goblin/head +goblin/head rotate: false - xy: 26, 361 - size: 103, 66 + xy: 107, 38 + size: 103, 64 orig: 103, 66 offset: 0, 0 index: -1 -images/goblin/torso - rotate: false - xy: 131, 414 +goblin/torso + rotate: true + xy: 212, 34 size: 68, 96 orig: 68, 96 offset: 0, 0 index: -1 -images/goblingirl/torso - rotate: false - xy: 26, 263 - size: 68, 96 - orig: 68, 96 +goblin/right-upper-leg + rotate: true + xy: 107, 2 + size: 34, 63 + orig: 34, 63 offset: 0, 0 index: -1 -images/dagger +goblin/left-lower-leg + rotate: true + xy: 172, 2 + size: 30, 70 + orig: 33, 70 + offset: 2, 0 + index: -1 +goblingirl/left-lower-leg + rotate: true + xy: 244, 2 + size: 30, 70 + orig: 33, 70 + offset: 2, 0 + index: -1 +goblin/undie-straps rotate: false - xy: 26, 153 + xy: 2, 2 + size: 55, 19 + orig: 55, 19 + offset: 0, 0 + index: -1 +dagger + rotate: true + xy: 372, 100 size: 26, 108 - orig: 26, 108 + orig: 156, 238 + offset: 100, 30 + index: -1 +goblingirl/torso + rotate: true + xy: 482, 60 + size: 66, 96 + orig: 68, 96 offset: 0, 0 index: -1 -images/goblin/right-lower-leg - rotate: false - xy: 201, 434 - size: 36, 76 +goblin/right-lower-leg + rotate: true + xy: 580, 91 + size: 35, 76 orig: 36, 76 - offset: 0, 0 + offset: 1, 0 index: -1 -images/goblingirl/right-lower-leg - rotate: false - xy: 54, 185 - size: 36, 76 +goblingirl/right-lower-leg + rotate: true + xy: 658, 91 + size: 35, 76 orig: 36, 76 - offset: 0, 0 + offset: 1, 0 index: -1 -images/goblin/left-upper-leg - rotate: false - xy: 96, 286 +goblin/left-upper-leg + rotate: true + xy: 736, 93 size: 33, 73 orig: 33, 73 offset: 0, 0 index: -1 -images/goblin/pelvis - rotate: false - xy: 131, 369 +goblin/pelvis + rotate: true + xy: 310, 40 size: 62, 43 orig: 62, 43 offset: 0, 0 index: -1 -images/goblingirl/pelvis +goblin/left-hand + rotate: true + xy: 316, 2 + size: 36, 41 + orig: 36, 41 + offset: 0, 0 + index: -1 +goblingirl/left-upper-leg + rotate: true + xy: 811, 93 + size: 33, 70 + orig: 33, 70 + offset: 0, 0 + index: -1 +goblin/left-foot rotate: false - xy: 131, 324 - size: 62, 43 + xy: 883, 95 + size: 65, 31 + orig: 65, 31 + offset: 0, 0 + index: -1 +goblingirl/left-foot + rotate: false + xy: 950, 95 + size: 65, 31 + orig: 65, 31 + offset: 0, 0 + index: -1 +goblin/right-foot + rotate: false + xy: 580, 56 + size: 63, 33 + orig: 63, 33 + offset: 0, 0 + index: -1 +goblingirl/right-foot + rotate: false + xy: 645, 56 + size: 63, 33 + orig: 63, 33 + offset: 0, 0 + index: -1 +goblingirl/pelvis + rotate: false + xy: 355, 55 + size: 59, 43 orig: 62, 43 - offset: 0, 0 + offset: 1, 0 index: -1 -images/goblin/right-foot - rotate: false - xy: 131, 289 - size: 63, 33 - orig: 63, 33 - offset: 0, 0 - index: -1 -images/goblin/left-lower-leg - rotate: false - xy: 2, 70 - size: 33, 70 - orig: 33, 70 - offset: 0, 0 - index: -1 -images/goblin/right-upper-leg - rotate: false - xy: 2, 5 +goblingirl/right-upper-leg + rotate: true + xy: 416, 64 size: 34, 63 orig: 34, 63 offset: 0, 0 index: -1 -images/goblingirl/left-lower-leg +goblin/right-shoulder rotate: false - xy: 195, 342 - size: 33, 70 - orig: 33, 70 + xy: 359, 11 + size: 39, 42 + orig: 39, 45 offset: 0, 0 index: -1 -images/goblingirl/left-upper-leg +goblingirl/undie-straps rotate: false - xy: 37, 81 - size: 33, 70 - orig: 33, 70 - offset: 0, 0 - index: -1 -images/goblingirl/right-upper-leg - rotate: false - xy: 38, 16 - size: 34, 63 - orig: 34, 63 - offset: 0, 0 - index: -1 -images/goblin/eyes-closed - rotate: false - xy: 38, 2 - size: 34, 12 - orig: 34, 12 - offset: 0, 0 - index: -1 -images/goblin/undies - rotate: false - xy: 54, 154 - size: 36, 29 - orig: 36, 29 - offset: 0, 0 - index: -1 -images/goblin/right-arm - rotate: false - xy: 72, 102 - size: 23, 50 - orig: 23, 50 - offset: 0, 0 - index: -1 -images/goblin/left-foot - rotate: false - xy: 131, 256 - size: 65, 31 - orig: 65, 31 - offset: 0, 0 - index: -1 -images/goblingirl/right-arm - rotate: false - xy: 196, 290 - size: 28, 50 - orig: 28, 50 - offset: 0, 0 - index: -1 -images/goblingirl/left-shoulder - rotate: false - xy: 226, 294 - size: 28, 46 - orig: 28, 46 - offset: 0, 0 - index: -1 -images/goblin/left-arm - rotate: false - xy: 198, 253 - size: 37, 35 - orig: 37, 35 - offset: 0, 0 - index: -1 -images/goblingirl/left-foot - rotate: false - xy: 92, 223 - size: 65, 31 - orig: 65, 31 - offset: 0, 0 - index: -1 -images/goblingirl/right-foot - rotate: false - xy: 92, 188 - size: 63, 33 - orig: 63, 33 - offset: 0, 0 - index: -1 -images/goblin/undie-straps - rotate: false - xy: 92, 167 + xy: 416, 43 size: 55, 19 orig: 55, 19 offset: 0, 0 index: -1 -images/goblingirl/left-arm - rotate: false - xy: 159, 219 +goblingirl/right-shoulder + rotate: true + xy: 400, 2 + size: 39, 42 + orig: 39, 45 + offset: 0, 0 + index: -1 +goblin/left-arm + rotate: true + xy: 444, 4 size: 37, 35 orig: 37, 35 offset: 0, 0 index: -1 -images/goblin/right-shoulder +goblin/neck rotate: false - xy: 97, 120 - size: 39, 45 - orig: 39, 45 - offset: 0, 0 - index: -1 -images/goblingirl/right-shoulder - rotate: false - xy: 198, 206 - size: 39, 45 - orig: 39, 45 - offset: 0, 0 - index: -1 -images/goblin/left-hand - rotate: false - xy: 157, 176 + xy: 481, 17 size: 36, 41 orig: 36, 41 offset: 0, 0 index: -1 -images/goblin/neck +goblingirl/left-hand rotate: false - xy: 195, 163 - size: 36, 41 - orig: 36, 41 - offset: 0, 0 - index: -1 -images/goblingirl/undie-straps - rotate: false - xy: 97, 99 - size: 55, 19 - orig: 55, 19 - offset: 0, 0 - index: -1 -images/goblingirl/neck - rotate: false - xy: 138, 120 - size: 35, 41 - orig: 35, 41 - offset: 0, 0 - index: -1 -images/goblingirl/left-hand - rotate: false - xy: 175, 121 + xy: 519, 18 size: 35, 40 orig: 35, 40 offset: 0, 0 index: -1 -images/goblin/left-shoulder +goblingirl/right-arm rotate: false - xy: 212, 117 + xy: 556, 8 + size: 22, 50 + orig: 28, 50 + offset: 3, 0 + index: -1 +goblingirl/neck + rotate: false + xy: 580, 13 + size: 33, 41 + orig: 35, 41 + offset: 0, 0 + index: -1 +goblin/left-shoulder + rotate: true + xy: 615, 25 size: 29, 44 orig: 29, 44 offset: 0, 0 index: -1 -images/goblingirl/eyes-closed +goblingirl/left-shoulder + rotate: true + xy: 661, 26 + size: 28, 45 + orig: 28, 46 + offset: 0, 1 + index: -1 +goblingirl/left-arm rotate: false - xy: 154, 97 - size: 37, 21 - orig: 37, 21 + xy: 710, 54 + size: 37, 35 + orig: 37, 35 offset: 0, 0 index: -1 -images/goblin/right-hand +goblin/right-arm rotate: false - xy: 193, 78 + xy: 708, 2 + size: 23, 50 + orig: 23, 50 + offset: 0, 0 + index: -1 +goblin/right-hand + rotate: false + xy: 749, 54 size: 36, 37 orig: 36, 37 offset: 0, 0 index: -1 -images/goblingirl/right-hand +goblingirl/right-hand rotate: false - xy: 74, 39 - size: 36, 37 + xy: 733, 15 + size: 35, 37 orig: 36, 37 - offset: 0, 0 + offset: 1, 0 index: -1 -images/goblingirl/undies +goblin/undies rotate: false - xy: 74, 8 + xy: 787, 62 size: 36, 29 orig: 36, 29 offset: 0, 0 index: -1 +goblingirl/undies + rotate: false + xy: 825, 62 + size: 36, 29 + orig: 36, 29 + offset: 0, 0 + index: -1 +goblingirl/eyes-closed + rotate: false + xy: 59, 6 + size: 37, 15 + orig: 37, 21 + offset: 0, 0 + index: -1 +goblin/eyes-closed + rotate: true + xy: 770, 18 + size: 34, 12 + orig: 34, 12 + offset: 0, 0 + index: -1 diff --git a/spine-unity/Assets/examples/data/goblins.atlas.txt.meta b/spine-unity/Assets/examples/data/goblins.atlas.txt.meta index c5065adff..8bd7d0d86 100644 --- a/spine-unity/Assets/examples/data/goblins.atlas.txt.meta +++ b/spine-unity/Assets/examples/data/goblins.atlas.txt.meta @@ -1,4 +1,2 @@ fileFormatVersion: 2 guid: 7d22747254815624999fd0ab7e8f851c -TextScriptImporter: - userData: diff --git a/spine-unity/Assets/examples/data/goblins.json.txt b/spine-unity/Assets/examples/data/goblins.json.txt index f1dcc96a0..95313ebe6 100644 --- a/spine-unity/Assets/examples/data/goblins.json.txt +++ b/spine-unity/Assets/examples/data/goblins.json.txt @@ -3,26 +3,26 @@ { "name": "root" }, { "name": "hip", "parent": "root", "x": 0.64, "y": 114.41 }, { "name": "left upper leg", "parent": "hip", "length": 50.39, "x": 14.45, "y": 2.81, "rotation": -89.09 }, - { "name": "left lower leg", "parent": "left upper leg", "length": 49.89, "x": 56.34, "y": 0.98, "rotation": -16.65 }, - { "name": "left foot", "parent": "left lower leg", "length": 46.5, "x": 58.94, "y": -7.61, "rotation": 102.43 }, + { "name": "pelvis", "parent": "hip", "x": 1.41, "y": -6.57 }, { "name": "right upper leg", "parent": "hip", "length": 42.45, "x": -20.07, "y": -6.83, "rotation": -97.49 }, - { "name": "right lower leg", "parent": "right upper leg", "length": 58.52, "x": 42.99, "y": -0.61, "rotation": -14.34 }, - { "name": "right foot", "parent": "right lower leg", "length": 45.45, "x": 64.88, "y": 0.04, "rotation": 110.3 }, { "name": "torso", "parent": "hip", "length": 85.82, "x": -6.42, "y": 1.97, "rotation": 93.92 }, - { "name": "neck", "parent": "torso", "length": 18.38, "x": 81.67, "y": -6.34, "rotation": -1.51 }, - { "name": "head", "parent": "neck", "length": 68.28, "x": 20.93, "y": 11.59, "rotation": -13.92 }, - { "name": "right shoulder", "parent": "torso", "length": 37.24, "x": 76.02, "y": 18.14, "rotation": 133.88 }, - { "name": "right arm", "parent": "right shoulder", "length": 36.74, "x": 37.6, "y": 0.31, "rotation": 36.32 }, - { "name": "right hand", "parent": "right arm", "length": 15.32, "x": 36.9, "y": 0.34, "rotation": 2.35 }, + { "name": "left lower leg", "parent": "left upper leg", "length": 49.89, "x": 56.34, "y": 0.98, "rotation": -16.65 }, { "name": "left shoulder", "parent": "torso", "length": 35.43, "x": 74.04, "y": -20.38, "rotation": -156.96 }, + { "name": "neck", "parent": "torso", "length": 18.38, "x": 81.67, "y": -6.34, "rotation": -1.51 }, + { "name": "right lower leg", "parent": "right upper leg", "length": 58.52, "x": 42.99, "y": -0.61, "rotation": -14.34 }, + { "name": "right shoulder", "parent": "torso", "length": 37.24, "x": 76.02, "y": 18.14, "rotation": 133.88 }, + { "name": "head", "parent": "neck", "length": 68.28, "x": 20.93, "y": 11.59, "rotation": -13.92 }, { "name": "left arm", "parent": "left shoulder", "length": 35.62, "x": 37.85, "y": -2.34, "rotation": 28.16 }, + { "name": "left foot", "parent": "left lower leg", "length": 46.5, "x": 58.94, "y": -7.61, "rotation": 102.43 }, + { "name": "right arm", "parent": "right shoulder", "length": 36.74, "x": 37.6, "y": 0.31, "rotation": 36.32 }, + { "name": "right foot", "parent": "right lower leg", "length": 45.45, "x": 64.88, "y": 0.04, "rotation": 110.3 }, { "name": "left hand", "parent": "left arm", "length": 11.52, "x": 35.62, "y": 0.07, "rotation": 2.7 }, - { "name": "pelvis", "parent": "hip", "x": 1.41, "y": -6.57 } + { "name": "right hand", "parent": "right arm", "length": 15.32, "x": 36.9, "y": 0.34, "rotation": 2.35 } ], "slots": [ { "name": "left shoulder", "bone": "left shoulder", "attachment": "left shoulder" }, { "name": "left arm", "bone": "left arm", "attachment": "left arm" }, - { "name": "left hand item", "bone": "left hand", "attachment": "spear" }, + { "name": "left hand item", "bone": "left hand", "attachment": "dagger" }, { "name": "left hand", "bone": "left hand", "attachment": "left hand" }, { "name": "left foot", "bone": "left foot", "attachment": "left foot" }, { "name": "left lower leg", "bone": "left lower leg", "attachment": "left lower leg" }, @@ -45,11 +45,11 @@ "skins": { "default": { "left hand item": { - "dagger": { "x": 7.88, "y": -23.45, "rotation": 10.47, "width": 26, "height": 108 }, + "dagger": { "x": -35.5, "y": 3.85, "rotation": 10.47, "width": 156, "height": 238 }, "spear": { "x": -4.55, "y": 39.2, "rotation": 13.04, "width": 22, "height": 368 } }, "right hand item": { - "dagger": { "x": 6.51, "y": -24.15, "rotation": -8.06, "width": 26, "height": 108 } + "dagger": { "x": -21.57, "y": 15.8, "rotation": -8.06, "width": 156, "height": 238 } } }, "goblin": { diff --git a/spine-unity/Assets/examples/data/goblins.json.txt.meta b/spine-unity/Assets/examples/data/goblins.json.txt.meta index a2339684c..5851b898d 100644 --- a/spine-unity/Assets/examples/data/goblins.json.txt.meta +++ b/spine-unity/Assets/examples/data/goblins.json.txt.meta @@ -1,4 +1,2 @@ fileFormatVersion: 2 guid: 06f2130f3bf8d4f499a15c55bdcda650 -TextScriptImporter: - userData: diff --git a/spine-unity/Assets/examples/data/goblins.png b/spine-unity/Assets/examples/data/goblins.png index 4315d4475..fc8b998cb 100644 Binary files a/spine-unity/Assets/examples/data/goblins.png and b/spine-unity/Assets/examples/data/goblins.png differ diff --git a/spine-unity/Assets/examples/data/goblins.png.meta b/spine-unity/Assets/examples/data/goblins.png.meta index 04e530b94..baf4634e0 100644 --- a/spine-unity/Assets/examples/data/goblins.png.meta +++ b/spine-unity/Assets/examples/data/goblins.png.meta @@ -19,7 +19,6 @@ TextureImporter: isReadable: 0 grayScaleToAlpha: 0 generateCubemap: 0 - seamlessCubemap: 0 textureFormat: -1 maxTextureSize: 1024 textureSettings: @@ -32,4 +31,3 @@ TextureImporter: compressionQuality: 50 textureType: -1 buildTargetSettings: [] - userData: diff --git a/spine-unity/Assets/examples/data/spineboy.atlas.txt.meta b/spine-unity/Assets/examples/data/spineboy.atlas.txt.meta index ad6f2b941..079615df0 100644 --- a/spine-unity/Assets/examples/data/spineboy.atlas.txt.meta +++ b/spine-unity/Assets/examples/data/spineboy.atlas.txt.meta @@ -1,4 +1,2 @@ fileFormatVersion: 2 guid: a42989bcd9f91aa49a56dc67cf27b96a -TextScriptImporter: - userData: diff --git a/spine-unity/Assets/examples/data/spineboy.json.txt.meta b/spine-unity/Assets/examples/data/spineboy.json.txt.meta index f01f449e4..8557b967a 100644 --- a/spine-unity/Assets/examples/data/spineboy.json.txt.meta +++ b/spine-unity/Assets/examples/data/spineboy.json.txt.meta @@ -1,4 +1,2 @@ fileFormatVersion: 2 guid: b84c2137744fea946bde0d5cd51e4e3d -TextScriptImporter: - userData: diff --git a/spine-unity/Assets/examples/data/spineboy.png.meta b/spine-unity/Assets/examples/data/spineboy.png.meta index 0f97295b7..9313caf06 100644 --- a/spine-unity/Assets/examples/data/spineboy.png.meta +++ b/spine-unity/Assets/examples/data/spineboy.png.meta @@ -19,7 +19,6 @@ TextureImporter: isReadable: 0 grayScaleToAlpha: 0 generateCubemap: 0 - seamlessCubemap: 0 textureFormat: -1 maxTextureSize: 1024 textureSettings: @@ -32,4 +31,3 @@ TextureImporter: compressionQuality: 50 textureType: -1 buildTargetSettings: [] - userData: diff --git a/spine-unity/README.md b/spine-unity/README.md index 3ec664aec..7f25173a4 100644 --- a/spine-unity/README.md +++ b/spine-unity/README.md @@ -11,3 +11,7 @@ Note that you *must* delete the Unity 4 directory or Unity will crash. 1. Delete the "Assets/examples/Unity 4" directory. 1. Open the "Assets/examples/Unity 3.5/spineboy.unity" scene. + +# Notes + +- Atlas images should use premultiplied alpha. diff --git a/spine-xna/example/data/goblins.atlas b/spine-xna/example/data/goblins.atlas index 271742263..ce74602e5 100644 --- a/spine-xna/example/data/goblins.atlas +++ b/spine-xna/example/data/goblins.atlas @@ -4,282 +4,282 @@ format: RGBA8888 filter: Linear,Linear repeat: none spear - rotate: false - xy: 2, 142 + rotate: true + xy: 2, 104 size: 22, 368 orig: 22, 368 offset: 0, 0 index: -1 goblingirl/head rotate: false - xy: 26, 429 - size: 103, 81 + xy: 2, 23 + size: 103, 79 orig: 103, 81 - offset: 0, 0 + offset: 0, 2 index: -1 goblin/head rotate: false - xy: 26, 361 - size: 103, 66 + xy: 107, 38 + size: 103, 64 orig: 103, 66 offset: 0, 0 index: -1 goblin/torso - rotate: false - xy: 131, 414 + rotate: true + xy: 212, 34 size: 68, 96 orig: 68, 96 offset: 0, 0 index: -1 -goblingirl/torso +goblin/right-upper-leg + rotate: true + xy: 107, 2 + size: 34, 63 + orig: 34, 63 + offset: 0, 0 + index: -1 +goblin/left-lower-leg + rotate: true + xy: 172, 2 + size: 30, 70 + orig: 33, 70 + offset: 2, 0 + index: -1 +goblingirl/left-lower-leg + rotate: true + xy: 244, 2 + size: 30, 70 + orig: 33, 70 + offset: 2, 0 + index: -1 +goblin/undie-straps rotate: false - xy: 26, 263 - size: 68, 96 - orig: 68, 96 + xy: 2, 2 + size: 55, 19 + orig: 55, 19 offset: 0, 0 index: -1 dagger - rotate: false - xy: 26, 153 + rotate: true + xy: 372, 100 size: 26, 108 - orig: 26, 108 + orig: 156, 238 + offset: 100, 30 + index: -1 +goblingirl/torso + rotate: true + xy: 482, 60 + size: 66, 96 + orig: 68, 96 offset: 0, 0 index: -1 goblin/right-lower-leg - rotate: false - xy: 201, 434 - size: 36, 76 + rotate: true + xy: 580, 91 + size: 35, 76 orig: 36, 76 - offset: 0, 0 + offset: 1, 0 index: -1 goblingirl/right-lower-leg - rotate: false - xy: 54, 185 - size: 36, 76 + rotate: true + xy: 658, 91 + size: 35, 76 orig: 36, 76 - offset: 0, 0 + offset: 1, 0 index: -1 goblin/left-upper-leg - rotate: false - xy: 96, 286 + rotate: true + xy: 736, 93 size: 33, 73 orig: 33, 73 offset: 0, 0 index: -1 goblin/pelvis - rotate: false - xy: 131, 369 + rotate: true + xy: 310, 40 size: 62, 43 orig: 62, 43 offset: 0, 0 index: -1 -goblingirl/pelvis - rotate: false - xy: 131, 324 - size: 62, 43 - orig: 62, 43 - offset: 0, 0 - index: -1 -goblin/right-foot - rotate: false - xy: 131, 289 - size: 63, 33 - orig: 63, 33 - offset: 0, 0 - index: -1 -goblin/left-lower-leg - rotate: false - xy: 2, 70 - size: 33, 70 - orig: 33, 70 - offset: 0, 0 - index: -1 -goblin/right-upper-leg - rotate: false - xy: 2, 5 - size: 34, 63 - orig: 34, 63 - offset: 0, 0 - index: -1 -goblingirl/left-lower-leg - rotate: false - xy: 195, 342 - size: 33, 70 - orig: 33, 70 +goblin/left-hand + rotate: true + xy: 316, 2 + size: 36, 41 + orig: 36, 41 offset: 0, 0 index: -1 goblingirl/left-upper-leg - rotate: false - xy: 37, 81 + rotate: true + xy: 811, 93 size: 33, 70 orig: 33, 70 offset: 0, 0 index: -1 -goblingirl/right-upper-leg - rotate: false - xy: 38, 16 - size: 34, 63 - orig: 34, 63 - offset: 0, 0 - index: -1 -goblin/eyes-closed - rotate: false - xy: 38, 2 - size: 34, 12 - orig: 34, 12 - offset: 0, 0 - index: -1 -goblin/undies - rotate: false - xy: 54, 154 - size: 36, 29 - orig: 36, 29 - offset: 0, 0 - index: -1 -goblin/right-arm - rotate: false - xy: 72, 102 - size: 23, 50 - orig: 23, 50 - offset: 0, 0 - index: -1 goblin/left-foot rotate: false - xy: 131, 256 + xy: 883, 95 size: 65, 31 orig: 65, 31 offset: 0, 0 index: -1 -goblingirl/right-arm - rotate: false - xy: 196, 290 - size: 28, 50 - orig: 28, 50 - offset: 0, 0 - index: -1 -goblingirl/left-shoulder - rotate: false - xy: 226, 294 - size: 28, 46 - orig: 28, 46 - offset: 0, 0 - index: -1 -goblin/left-arm - rotate: false - xy: 198, 253 - size: 37, 35 - orig: 37, 35 - offset: 0, 0 - index: -1 goblingirl/left-foot rotate: false - xy: 92, 223 + xy: 950, 95 size: 65, 31 orig: 65, 31 offset: 0, 0 index: -1 -goblingirl/right-foot +goblin/right-foot rotate: false - xy: 92, 188 + xy: 580, 56 size: 63, 33 orig: 63, 33 offset: 0, 0 index: -1 -goblin/undie-straps +goblingirl/right-foot rotate: false - xy: 92, 167 - size: 55, 19 - orig: 55, 19 + xy: 645, 56 + size: 63, 33 + orig: 63, 33 offset: 0, 0 index: -1 -goblingirl/left-arm +goblingirl/pelvis rotate: false - xy: 159, 219 - size: 37, 35 - orig: 37, 35 + xy: 355, 55 + size: 59, 43 + orig: 62, 43 + offset: 1, 0 + index: -1 +goblingirl/right-upper-leg + rotate: true + xy: 416, 64 + size: 34, 63 + orig: 34, 63 offset: 0, 0 index: -1 goblin/right-shoulder rotate: false - xy: 97, 120 - size: 39, 45 + xy: 359, 11 + size: 39, 42 orig: 39, 45 offset: 0, 0 index: -1 -goblingirl/right-shoulder - rotate: false - xy: 198, 206 - size: 39, 45 - orig: 39, 45 - offset: 0, 0 - index: -1 -goblin/left-hand - rotate: false - xy: 157, 176 - size: 36, 41 - orig: 36, 41 - offset: 0, 0 - index: -1 -goblin/neck - rotate: false - xy: 195, 163 - size: 36, 41 - orig: 36, 41 - offset: 0, 0 - index: -1 goblingirl/undie-straps rotate: false - xy: 97, 99 + xy: 416, 43 size: 55, 19 orig: 55, 19 offset: 0, 0 index: -1 -goblingirl/neck +goblingirl/right-shoulder + rotate: true + xy: 400, 2 + size: 39, 42 + orig: 39, 45 + offset: 0, 0 + index: -1 +goblin/left-arm + rotate: true + xy: 444, 4 + size: 37, 35 + orig: 37, 35 + offset: 0, 0 + index: -1 +goblin/neck rotate: false - xy: 138, 120 - size: 35, 41 - orig: 35, 41 + xy: 481, 17 + size: 36, 41 + orig: 36, 41 offset: 0, 0 index: -1 goblingirl/left-hand rotate: false - xy: 175, 121 + xy: 519, 18 size: 35, 40 orig: 35, 40 offset: 0, 0 index: -1 -goblin/left-shoulder +goblingirl/right-arm rotate: false - xy: 212, 117 + xy: 556, 8 + size: 22, 50 + orig: 28, 50 + offset: 3, 0 + index: -1 +goblingirl/neck + rotate: false + xy: 580, 13 + size: 33, 41 + orig: 35, 41 + offset: 0, 0 + index: -1 +goblin/left-shoulder + rotate: true + xy: 615, 25 size: 29, 44 orig: 29, 44 offset: 0, 0 index: -1 -goblingirl/eyes-closed +goblingirl/left-shoulder + rotate: true + xy: 661, 26 + size: 28, 45 + orig: 28, 46 + offset: 0, 1 + index: -1 +goblingirl/left-arm rotate: false - xy: 154, 97 - size: 37, 21 - orig: 37, 21 + xy: 710, 54 + size: 37, 35 + orig: 37, 35 + offset: 0, 0 + index: -1 +goblin/right-arm + rotate: false + xy: 708, 2 + size: 23, 50 + orig: 23, 50 offset: 0, 0 index: -1 goblin/right-hand rotate: false - xy: 193, 78 + xy: 749, 54 size: 36, 37 orig: 36, 37 offset: 0, 0 index: -1 goblingirl/right-hand rotate: false - xy: 74, 39 - size: 36, 37 + xy: 733, 15 + size: 35, 37 orig: 36, 37 - offset: 0, 0 + offset: 1, 0 index: -1 -goblingirl/undies +goblin/undies rotate: false - xy: 74, 8 + xy: 787, 62 size: 36, 29 orig: 36, 29 offset: 0, 0 index: -1 +goblingirl/undies + rotate: false + xy: 825, 62 + size: 36, 29 + orig: 36, 29 + offset: 0, 0 + index: -1 +goblingirl/eyes-closed + rotate: false + xy: 59, 6 + size: 37, 15 + orig: 37, 21 + offset: 0, 0 + index: -1 +goblin/eyes-closed + rotate: true + xy: 770, 18 + size: 34, 12 + orig: 34, 12 + offset: 0, 0 + index: -1 diff --git a/spine-xna/example/data/goblins.json b/spine-xna/example/data/goblins.json index f1dcc96a0..95313ebe6 100644 --- a/spine-xna/example/data/goblins.json +++ b/spine-xna/example/data/goblins.json @@ -3,26 +3,26 @@ { "name": "root" }, { "name": "hip", "parent": "root", "x": 0.64, "y": 114.41 }, { "name": "left upper leg", "parent": "hip", "length": 50.39, "x": 14.45, "y": 2.81, "rotation": -89.09 }, - { "name": "left lower leg", "parent": "left upper leg", "length": 49.89, "x": 56.34, "y": 0.98, "rotation": -16.65 }, - { "name": "left foot", "parent": "left lower leg", "length": 46.5, "x": 58.94, "y": -7.61, "rotation": 102.43 }, + { "name": "pelvis", "parent": "hip", "x": 1.41, "y": -6.57 }, { "name": "right upper leg", "parent": "hip", "length": 42.45, "x": -20.07, "y": -6.83, "rotation": -97.49 }, - { "name": "right lower leg", "parent": "right upper leg", "length": 58.52, "x": 42.99, "y": -0.61, "rotation": -14.34 }, - { "name": "right foot", "parent": "right lower leg", "length": 45.45, "x": 64.88, "y": 0.04, "rotation": 110.3 }, { "name": "torso", "parent": "hip", "length": 85.82, "x": -6.42, "y": 1.97, "rotation": 93.92 }, - { "name": "neck", "parent": "torso", "length": 18.38, "x": 81.67, "y": -6.34, "rotation": -1.51 }, - { "name": "head", "parent": "neck", "length": 68.28, "x": 20.93, "y": 11.59, "rotation": -13.92 }, - { "name": "right shoulder", "parent": "torso", "length": 37.24, "x": 76.02, "y": 18.14, "rotation": 133.88 }, - { "name": "right arm", "parent": "right shoulder", "length": 36.74, "x": 37.6, "y": 0.31, "rotation": 36.32 }, - { "name": "right hand", "parent": "right arm", "length": 15.32, "x": 36.9, "y": 0.34, "rotation": 2.35 }, + { "name": "left lower leg", "parent": "left upper leg", "length": 49.89, "x": 56.34, "y": 0.98, "rotation": -16.65 }, { "name": "left shoulder", "parent": "torso", "length": 35.43, "x": 74.04, "y": -20.38, "rotation": -156.96 }, + { "name": "neck", "parent": "torso", "length": 18.38, "x": 81.67, "y": -6.34, "rotation": -1.51 }, + { "name": "right lower leg", "parent": "right upper leg", "length": 58.52, "x": 42.99, "y": -0.61, "rotation": -14.34 }, + { "name": "right shoulder", "parent": "torso", "length": 37.24, "x": 76.02, "y": 18.14, "rotation": 133.88 }, + { "name": "head", "parent": "neck", "length": 68.28, "x": 20.93, "y": 11.59, "rotation": -13.92 }, { "name": "left arm", "parent": "left shoulder", "length": 35.62, "x": 37.85, "y": -2.34, "rotation": 28.16 }, + { "name": "left foot", "parent": "left lower leg", "length": 46.5, "x": 58.94, "y": -7.61, "rotation": 102.43 }, + { "name": "right arm", "parent": "right shoulder", "length": 36.74, "x": 37.6, "y": 0.31, "rotation": 36.32 }, + { "name": "right foot", "parent": "right lower leg", "length": 45.45, "x": 64.88, "y": 0.04, "rotation": 110.3 }, { "name": "left hand", "parent": "left arm", "length": 11.52, "x": 35.62, "y": 0.07, "rotation": 2.7 }, - { "name": "pelvis", "parent": "hip", "x": 1.41, "y": -6.57 } + { "name": "right hand", "parent": "right arm", "length": 15.32, "x": 36.9, "y": 0.34, "rotation": 2.35 } ], "slots": [ { "name": "left shoulder", "bone": "left shoulder", "attachment": "left shoulder" }, { "name": "left arm", "bone": "left arm", "attachment": "left arm" }, - { "name": "left hand item", "bone": "left hand", "attachment": "spear" }, + { "name": "left hand item", "bone": "left hand", "attachment": "dagger" }, { "name": "left hand", "bone": "left hand", "attachment": "left hand" }, { "name": "left foot", "bone": "left foot", "attachment": "left foot" }, { "name": "left lower leg", "bone": "left lower leg", "attachment": "left lower leg" }, @@ -45,11 +45,11 @@ "skins": { "default": { "left hand item": { - "dagger": { "x": 7.88, "y": -23.45, "rotation": 10.47, "width": 26, "height": 108 }, + "dagger": { "x": -35.5, "y": 3.85, "rotation": 10.47, "width": 156, "height": 238 }, "spear": { "x": -4.55, "y": 39.2, "rotation": 13.04, "width": 22, "height": 368 } }, "right hand item": { - "dagger": { "x": 6.51, "y": -24.15, "rotation": -8.06, "width": 26, "height": 108 } + "dagger": { "x": -21.57, "y": 15.8, "rotation": -8.06, "width": 156, "height": 238 } } }, "goblin": { diff --git a/spine-xna/example/data/goblins.png b/spine-xna/example/data/goblins.png index 863b29467..1d6f59e37 100644 Binary files a/spine-xna/example/data/goblins.png and b/spine-xna/example/data/goblins.png differ diff --git a/spine-xna/src/SkeletonRenderer.cs b/spine-xna/src/SkeletonRenderer.cs index c24a71432..b9acbc274 100644 --- a/spine-xna/src/SkeletonRenderer.cs +++ b/spine-xna/src/SkeletonRenderer.cs @@ -78,7 +78,7 @@ namespace Spine { RegionAttachment regionAttachment = (RegionAttachment)attachment; SpriteBatchItem item = batcher.CreateBatchItem(); - item.Texture = (Texture2D)regionAttachment.Region.page.texture; + item.Texture = (Texture2D)regionAttachment.Texture; byte r = (byte)(skeleton.R * slot.R * 255); byte g = (byte)(skeleton.G * slot.G * 255); @@ -116,26 +116,15 @@ namespace Spine { item.vertexTR.Position.Y = vertices[RegionAttachment.Y4]; item.vertexTR.Position.Z = 0; - AtlasRegion region = regionAttachment.Region; - if (region.rotate) { - item.vertexBL.TextureCoordinate.X = region.u; - item.vertexBL.TextureCoordinate.Y = region.v2; - item.vertexBR.TextureCoordinate.X = region.u; - item.vertexBR.TextureCoordinate.Y = region.v; - item.vertexTR.TextureCoordinate.X = region.u2; - item.vertexTR.TextureCoordinate.Y = region.v; - item.vertexTL.TextureCoordinate.X = region.u2; - item.vertexTL.TextureCoordinate.Y = region.v2; - } else { - item.vertexTL.TextureCoordinate.X = region.u; - item.vertexTL.TextureCoordinate.Y = region.v2; - item.vertexBL.TextureCoordinate.X = region.u; - item.vertexBL.TextureCoordinate.Y = region.v; - item.vertexBR.TextureCoordinate.X = region.u2; - item.vertexBR.TextureCoordinate.Y = region.v; - item.vertexTR.TextureCoordinate.X = region.u2; - item.vertexTR.TextureCoordinate.Y = region.v2; - } + float[] uvs = regionAttachment.UVs; + item.vertexTL.TextureCoordinate.X = uvs[RegionAttachment.X1]; + item.vertexTL.TextureCoordinate.Y = uvs[RegionAttachment.Y1]; + item.vertexBL.TextureCoordinate.X = uvs[RegionAttachment.X2]; + item.vertexBL.TextureCoordinate.Y = uvs[RegionAttachment.Y2]; + item.vertexBR.TextureCoordinate.X = uvs[RegionAttachment.X3]; + item.vertexBR.TextureCoordinate.Y = uvs[RegionAttachment.Y3]; + item.vertexTR.TextureCoordinate.X = uvs[RegionAttachment.X4]; + item.vertexTR.TextureCoordinate.Y = uvs[RegionAttachment.Y4]; } } }