From cd33df65b44f335de92d08cf325f23a6d91b5edb Mon Sep 17 00:00:00 2001 From: Tom Date: Wed, 3 Apr 2024 21:14:55 +0100 Subject: [PATCH] Add compatibility with FNA (#106) * Rectangles in FNA don't support initialization with two vectors. TextureAtlas.cs changed to use the Rectangle constructor with four parameters. * added MonoGame.Aseprite.FNA.csproj, which presumably would be the least surprising way of adding Monogame.Aseprite to a FNA project * removed from FNA project file item groups and property groups related to NuGet package stuff --- .../MonoGame.Aseprite.FNA.csproj | 15 +++++++++++++++ source/MonoGame.Aseprite/TextureAtlas.cs | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 source/MonoGame.Aseprite/MonoGame.Aseprite.FNA.csproj diff --git a/source/MonoGame.Aseprite/MonoGame.Aseprite.FNA.csproj b/source/MonoGame.Aseprite/MonoGame.Aseprite.FNA.csproj new file mode 100644 index 0000000..2b12e49 --- /dev/null +++ b/source/MonoGame.Aseprite/MonoGame.Aseprite.FNA.csproj @@ -0,0 +1,15 @@ + + + + + net8.0 + true + + + + + + + + + \ No newline at end of file diff --git a/source/MonoGame.Aseprite/TextureAtlas.cs b/source/MonoGame.Aseprite/TextureAtlas.cs index 7e2ac7b..055aff8 100644 --- a/source/MonoGame.Aseprite/TextureAtlas.cs +++ b/source/MonoGame.Aseprite/TextureAtlas.cs @@ -128,7 +128,7 @@ public TextureRegion CreateRegion(string name, int x, int y, int width, int heig /// /// The created by this method. public TextureRegion CreateRegion(string name, Point location, Point size) => - CreateRegion(name, new Rectangle(location, size)); + CreateRegion(name, new Rectangle(location.X, location.Y, size.X, size.Y)); /// /// Creates a new and adds it to this .