mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
Make vertices static.
This commit is contained in:
parent
4b31d81923
commit
037a156e73
@ -55,17 +55,15 @@ import starling.utils.VertexData;
|
|||||||
public class SkeletonSprite extends DisplayObject implements IAnimatable {
|
public class SkeletonSprite extends DisplayObject implements IAnimatable {
|
||||||
static private var tempPoint:Point = new Point();
|
static private var tempPoint:Point = new Point();
|
||||||
static private var tempMatrix:Matrix = new Matrix();
|
static private var tempMatrix:Matrix = new Matrix();
|
||||||
|
static private var tempVertices:Vector.<Number> = new Vector.<Number>(8);
|
||||||
|
|
||||||
private var _skeleton:Skeleton;
|
private var _skeleton:Skeleton;
|
||||||
private var vertices:Vector.<Number> = new Vector.<Number>();
|
|
||||||
|
|
||||||
public function SkeletonSprite (skeletonData:SkeletonData) {
|
public function SkeletonSprite (skeletonData:SkeletonData) {
|
||||||
Bone.yDown = true;
|
Bone.yDown = true;
|
||||||
|
|
||||||
_skeleton = new Skeleton(skeletonData);
|
_skeleton = new Skeleton(skeletonData);
|
||||||
_skeleton.updateWorldTransform();
|
_skeleton.updateWorldTransform();
|
||||||
|
|
||||||
vertices.length = 8;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function advanceTime (delta:Number) : void {
|
public function advanceTime (delta:Number) : void {
|
||||||
@ -84,7 +82,7 @@ public class SkeletonSprite extends DisplayObject implements IAnimatable {
|
|||||||
var slot:Slot = drawOrder[i];
|
var slot:Slot = drawOrder[i];
|
||||||
var regionAttachment:RegionAttachment = slot.attachment as RegionAttachment;
|
var regionAttachment:RegionAttachment = slot.attachment as RegionAttachment;
|
||||||
if (regionAttachment != null) {
|
if (regionAttachment != null) {
|
||||||
var vertices:Vector.<Number> = this.vertices;
|
var vertices:Vector.<Number> = tempVertices;
|
||||||
regionAttachment.computeWorldVertices(x, y, slot.bone, vertices);
|
regionAttachment.computeWorldVertices(x, y, slot.bone, vertices);
|
||||||
var a:Number = slot.a;
|
var a:Number = slot.a;
|
||||||
var rgb:uint = Color.rgb(r * slot.r, g * slot.g, b * slot.b);
|
var rgb:uint = Color.rgb(r * slot.r, g * slot.g, b * slot.b);
|
||||||
@ -131,7 +129,7 @@ public class SkeletonSprite extends DisplayObject implements IAnimatable {
|
|||||||
if (!regionAttachment)
|
if (!regionAttachment)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
var vertices:Vector.<Number> = this.vertices;
|
var vertices:Vector.<Number> = tempVertices;
|
||||||
regionAttachment.computeWorldVertices(skeleton.x, skeleton.y, slot.bone, vertices);
|
regionAttachment.computeWorldVertices(skeleton.x, skeleton.y, slot.bone, vertices);
|
||||||
|
|
||||||
value = vertices[0];
|
value = vertices[0];
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user