Przeglądaj źródła

[monogame] Upgraded to latest MonoGame version, fixed y-flipping in example.

badlogic 6 lat temu
rodzic
commit
a29dbcaf97

+ 1 - 1
spine-csharp/src/SkeletonClipping.cs

@@ -270,7 +270,7 @@ namespace Spine {
 			return clipped;
 			return clipped;
 		}
 		}
 
 
-		static void MakeClockwise (ExposedList<float> polygon) {
+		public static void MakeClockwise (ExposedList<float> polygon) {
 			float[] vertices = polygon.Items;
 			float[] vertices = polygon.Items;
 			int verticeslength = polygon.Count;
 			int verticeslength = polygon.Count;
 
 

+ 1 - 1
spine-csharp/src/Triangulator.cs

@@ -31,7 +31,7 @@
 using System;
 using System;
 
 
 namespace Spine {
 namespace Spine {
-	internal class Triangulator {
+	public class Triangulator {
 		private readonly ExposedList<ExposedList<float>> convexPolygons = new ExposedList<ExposedList<float>>();
 		private readonly ExposedList<ExposedList<float>> convexPolygons = new ExposedList<ExposedList<float>>();
 		private readonly ExposedList<ExposedList<int>> convexPolygonsIndices = new ExposedList<ExposedList<int>>();
 		private readonly ExposedList<ExposedList<int>> convexPolygonsIndices = new ExposedList<ExposedList<int>>();
 
 

+ 7 - 6
spine-monogame/example/ExampleGame.cs

@@ -65,9 +65,9 @@ namespace Spine {
 
 
 			// String name = "spineboy-ess";
 			// String name = "spineboy-ess";
 			// String name = "goblins-pro";
 			// String name = "goblins-pro";
-			// String name = "raptor-pro";
+			String name = "raptor-pro";
 			// String name = "tank-pro";
 			// String name = "tank-pro";
-			String name = "coin-pro";
+			// String name = "coin-pro";
 			String atlasName = name.Replace("-pro", "").Replace("-ess", "");
 			String atlasName = name.Replace("-pro", "").Replace("-ess", "");
 			bool binaryData = false;
 			bool binaryData = false;
 
 
@@ -109,17 +109,17 @@ namespace Spine {
 				state.Complete += Complete;
 				state.Complete += Complete;
 				state.Event += Event;
 				state.Event += Event;
 
 
-				state.SetAnimation(0, "test", false);
+				state.SetAnimation(0, "run", false);
 				TrackEntry entry = state.AddAnimation(0, "jump", false, 0);
 				TrackEntry entry = state.AddAnimation(0, "jump", false, 0);
 				entry.End += End; // Event handling for queued animations.
 				entry.End += End; // Event handling for queued animations.
 				state.AddAnimation(0, "run", true, 0);
 				state.AddAnimation(0, "run", true, 0);
 			}
 			}
 			else if (name == "raptor-pro") {
 			else if (name == "raptor-pro") {
 				state.SetAnimation(0, "walk", true);
 				state.SetAnimation(0, "walk", true);
-				state.AddAnimation(1, "gungrab", false, 2);
+				state.AddAnimation(1, "gun-grab", false, 2);
 			}
 			}
 			else if (name == "coin-pro") {
 			else if (name == "coin-pro") {
-				state.SetAnimation(0, "rotate", true);
+				state.SetAnimation(0, "animation", true);
 			}
 			}
 			else if (name == "tank-pro") {
 			else if (name == "tank-pro") {
 				state.SetAnimation(0, "drive", true);
 				state.SetAnimation(0, "drive", true);
@@ -127,9 +127,10 @@ namespace Spine {
 			else {
 			else {
 				state.SetAnimation(0, "walk", true);
 				state.SetAnimation(0, "walk", true);
 			}
 			}
-
+           
 			skeleton.X = 400 + (name == "tank-pro" ? 300 : 0);
 			skeleton.X = 400 + (name == "tank-pro" ? 300 : 0);
 			skeleton.Y = GraphicsDevice.Viewport.Height;
 			skeleton.Y = GraphicsDevice.Viewport.Height;
+            skeleton.ScaleY = -1;
 			skeleton.UpdateWorldTransform();
 			skeleton.UpdateWorldTransform();
 
 
 			headSlot = skeleton.FindSlot("head");
 			headSlot = skeleton.FindSlot("head");

+ 9 - 0
spine-monogame/example/spine-monogame-example.csproj

@@ -42,6 +42,15 @@
     <ApplicationManifest>app.manifest</ApplicationManifest>
     <ApplicationManifest>app.manifest</ApplicationManifest>
   </PropertyGroup>
   </PropertyGroup>
   <ItemGroup>
   <ItemGroup>
+    <Compile Include="..\..\spine-xna\src\ShapeRenderer.cs">
+      <Link>spine-xna\ShapeRenderer.cs</Link>
+    </Compile>
+    <Compile Include="..\..\spine-xna\src\SkeletonDebugRenderer.cs">
+      <Link>spine-xna\SkeletonDebugRenderer.cs</Link>
+    </Compile>
+    <Compile Include="..\..\spine-xna\src\VertexEffect.cs">
+      <Link>spine-xna\VertexEffect.cs</Link>
+    </Compile>    
     <Compile Include="..\..\spine-xna\src\MeshBatcher.cs">
     <Compile Include="..\..\spine-xna\src\MeshBatcher.cs">
       <Link>spine-xna\MeshBatcher.cs</Link>
       <Link>spine-xna\MeshBatcher.cs</Link>
     </Compile>
     </Compile>

+ 0 - 0
spine-xna/example/data/goblins-mesh.atlas → spine-xna/example/data/goblins.atlas