|
@@ -59,9 +59,9 @@ package spine.starling {
|
|
|
static private var _tempMatrix : Matrix = new Matrix();
|
|
|
static private var _tempVertices : Vector.<Number> = new Vector.<Number>(8);
|
|
|
static internal var blendModes : Vector.<String> = new <String>[BlendMode.NORMAL, BlendMode.ADD, BlendMode.MULTIPLY, BlendMode.SCREEN];
|
|
|
- private var _skeleton : Skeleton;
|
|
|
- public var batchable : Boolean = true;
|
|
|
+ private var _skeleton : Skeleton;
|
|
|
private var _smoothing : String = "bilinear";
|
|
|
+ private var _twoColorTint : Boolean = false;
|
|
|
private static var clipper: SkeletonClipping = new SkeletonClipping();
|
|
|
private static var QUAD_INDICES : Vector.<uint> = new <uint>[0, 1, 2, 2, 3, 0];
|
|
|
|
|
@@ -112,7 +112,7 @@ package spine.starling {
|
|
|
region.rendererObject = mesh = new SkeletonMesh(Image(region.rendererObject).texture);
|
|
|
if (region.rendererObject is AtlasRegion)
|
|
|
region.rendererObject = mesh = new SkeletonMesh(Image(AtlasRegion(region.rendererObject).rendererObject).texture);
|
|
|
- mesh.setStyle(new TwoColorMeshStyle());
|
|
|
+ if (_twoColorTint) mesh.setStyle(new TwoColorMeshStyle());
|
|
|
indexData = mesh.getIndexData();
|
|
|
for (ii = 0; ii < indices.length; ii++)
|
|
|
indexData.setIndex(ii, indices[ii]);
|
|
@@ -136,7 +136,7 @@ package spine.starling {
|
|
|
meshAttachment.rendererObject = mesh = new SkeletonMesh(Image(meshAttachment.rendererObject).texture);
|
|
|
if (meshAttachment.rendererObject is AtlasRegion)
|
|
|
meshAttachment.rendererObject = mesh = new SkeletonMesh(Image(AtlasRegion(meshAttachment.rendererObject).rendererObject).texture);
|
|
|
- mesh.setStyle(new TwoColorMeshStyle());
|
|
|
+ if (_twoColorTint) mesh.setStyle(new TwoColorMeshStyle());
|
|
|
|
|
|
indexData = mesh.getIndexData();
|
|
|
indicesLength = meshAttachment.triangles.length;
|
|
@@ -198,13 +198,13 @@ package spine.starling {
|
|
|
tempVertex.dark.setFromColor(tempDark);
|
|
|
vertexEffect.transform(tempVertex);
|
|
|
vertexData.colorize("color", Color.rgb(tempVertex.light.r * 255, tempVertex.light.g * 255, tempVertex.light.b * 255), tempVertex.light.a, ii, 1);
|
|
|
- vertexData.colorize("color2", Color.rgb(tempVertex.dark.r * 255, tempVertex.dark.g * 255, tempVertex.dark.b * 255), a, ii, 1);
|
|
|
+ if (_twoColorTint) vertexData.colorize("color2", Color.rgb(tempVertex.dark.r * 255, tempVertex.dark.g * 255, tempVertex.dark.b * 255), a, ii, 1);
|
|
|
mesh.setVertexPosition(ii, tempVertex.x, tempVertex.y);
|
|
|
mesh.setTexCoords(ii, tempVertex.u, tempVertex.v);
|
|
|
}
|
|
|
} else {
|
|
|
vertexData.colorize("color", rgb, a);
|
|
|
- vertexData.colorize("color2", dark);
|
|
|
+ if (_twoColorTint) vertexData.colorize("color2", dark);
|
|
|
for (ii = 0, iii = 0; ii < verticesCount; ii++, iii += 2) {
|
|
|
mesh.setVertexPosition(ii, worldVertices[iii], worldVertices[iii + 1]);
|
|
|
mesh.setTexCoords(ii, uvs[iii], uvs[iii + 1]);
|
|
@@ -303,5 +303,13 @@ package spine.starling {
|
|
|
public function set smoothing(smoothing : String) : void {
|
|
|
_smoothing = smoothing;
|
|
|
}
|
|
|
+
|
|
|
+ public function get twoColorTint() : Boolean {
|
|
|
+ return _twoColorTint;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function set twoColorTint(tint : Boolean) : void {
|
|
|
+ _twoColorTint = tint;
|
|
|
+ }
|
|
|
}
|
|
|
}
|