Skip to content

Commit

Permalink
Add compatibility with FNA (#106)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
nobledemon authored Apr 3, 2024
1 parent fb66ecc commit cd33df6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions source/MonoGame.Aseprite/MonoGame.Aseprite.FNA.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<!-- Project level compilation properties -->
<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

<!-- Project References -->
<ItemGroup>
<ProjectReference Include="..\..\..\AsepriteDotNet\source\AsepriteDotNet\AsepriteDotNet.csproj" />
<ProjectReference Include="..\..\..\FNA\FNA.Core.csproj" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion source/MonoGame.Aseprite/TextureAtlas.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public TextureRegion CreateRegion(string name, int x, int y, int width, int heig
/// </exception>
/// <returns>The <see cref="TextureRegion"/> created by this method.</returns>
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));

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

0 comments on commit cd33df6

Please sign in to comment.