Skip to content

Commit cd33df6

Browse files
authored
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
1 parent fb66ecc commit cd33df6

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<!-- Project level compilation properties -->
4+
<PropertyGroup>
5+
<TargetFrameworks>net8.0</TargetFrameworks>
6+
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
7+
</PropertyGroup>
8+
9+
<!-- Project References -->
10+
<ItemGroup>
11+
<ProjectReference Include="..\..\..\AsepriteDotNet\source\AsepriteDotNet\AsepriteDotNet.csproj" />
12+
<ProjectReference Include="..\..\..\FNA\FNA.Core.csproj" />
13+
</ItemGroup>
14+
15+
</Project>

source/MonoGame.Aseprite/TextureAtlas.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public TextureRegion CreateRegion(string name, int x, int y, int width, int heig
128128
/// </exception>
129129
/// <returns>The <see cref="TextureRegion"/> created by this method.</returns>
130130
public TextureRegion CreateRegion(string name, Point location, Point size) =>
131-
CreateRegion(name, new Rectangle(location, size));
131+
CreateRegion(name, new Rectangle(location.X, location.Y, size.X, size.Y));
132132

133133
/// <summary>
134134
/// Creates a new <see cref="TextureRegion"/> and adds it to this <see cref="TextureAtlas"/>.

0 commit comments

Comments
 (0)