mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-06 15:24:55 +08:00
[starling] Closes #662. Each region attachment receives a renderObject which is a Starling Image. A Starling Image is essentially like a libGDX region, holding a texture and uvs. When two slots share the same region attachment, we run into issues. E.g. if the slots differ in color, the shared Image color will be set to the last slot being drawn. Since Starling does batching, stuff breaks.
This commit is contained in:
parent
d27e1cd845
commit
ddb7e52a41
Binary file not shown.
@ -9,14 +9,5 @@
|
||||
<resource>SDK:frameworks/libs/core.swc</resource>
|
||||
<resource>SDK:frameworks/libs/osmf.swc</resource>
|
||||
<resource>SDK:frameworks/libs/textLayout.swc</resource>
|
||||
<resource>frameworks/libs/air/aircore.swc</resource>
|
||||
<resource>frameworks/libs/air/airglobal.swc</resource>
|
||||
<resource>frameworks/libs/air/applicationupdater.swc</resource>
|
||||
<resource>frameworks/libs/air/applicationupdater_ui.swc</resource>
|
||||
<resource>frameworks/libs/air/servicemonitor.swc</resource>
|
||||
<resource>frameworks/libs/authoringsupport.swc</resource>
|
||||
<resource>frameworks/libs/core.swc</resource>
|
||||
<resource>frameworks/libs/osmf.swc</resource>
|
||||
<resource>frameworks/libs/textLayout.swc</resource>
|
||||
</exclude>
|
||||
|
||||
|
||||
@ -99,7 +99,14 @@ public class SkeletonSprite extends DisplayObject {
|
||||
b * slot.b * region.b);
|
||||
|
||||
var image:Image = region.rendererObject as Image;
|
||||
if (image == null) region.rendererObject = image = Image(AtlasRegion(region.rendererObject).rendererObject);
|
||||
if (image == null) {
|
||||
var origImage:Image = Image(AtlasRegion(region.rendererObject).rendererObject);
|
||||
region.rendererObject = image = new Image(origImage.texture);
|
||||
for (var j:int = 0; j < 4; j++) {
|
||||
var p: Point = origImage.getTexCoords(j);
|
||||
image.setTexCoords(j, p.x, p.y);
|
||||
}
|
||||
}
|
||||
|
||||
image.setVertexPosition(0, worldVertices[2], worldVertices[3]);
|
||||
image.setVertexColor(0, rgb);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user