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

This commit is contained in:
badlogic 2019-04-11 16:16:25 +02:00
parent 4f0b7bef2c
commit a29dbcaf97
5 changed files with 18 additions and 8 deletions

View File

@ -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;

View File

@ -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>>();

View File

@ -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");

View File

@ -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>