Quellcode durchsuchen

[xna] Added a Z property to SkeletonRenderer to provide a constant Z offset added at all vertices.

Harald Csaszar vor 4 Jahren
Ursprung
Commit
968a7b5777
1 geänderte Dateien mit 5 neuen und 1 gelöschten Zeilen
  1. 5 1
      spine-xna/src/SkeletonRenderer.cs

+ 5 - 1
spine-xna/src/SkeletonRenderer.cs

@@ -62,6 +62,10 @@ namespace Spine {
 		private float zSpacing = 0.0f;
 		public float ZSpacing { get { return zSpacing; } set { zSpacing = value; } }
 
+		/// <summary>A Z position offset added at each vertex.</summary>
+		private float z = 0.0f;
+		public float Z { get { return z; } set { z = value; } }
+
 		public SkeletonRenderer (GraphicsDevice device) {
 			this.device = device;
 
@@ -106,7 +110,7 @@ namespace Spine {
 			for (int i = 0, n = drawOrder.Count; i < n; i++) {
 				Slot slot = drawOrderItems[i];
 				Attachment attachment = slot.Attachment;
-				float attachmentZOffset = zSpacing * i;
+				float attachmentZOffset = z + zSpacing * i;
 
 				float attachmentColorR, attachmentColorG, attachmentColorB, attachmentColorA;
 				object textureObject = null;