Releases: AristurtleDev/monogame-aseprite
[HotFix] Version 4.0.3
This is a hotfix release to resolve the following issues:
- Fixed crash in
TextureAtlas.FromRaw
where loop for slices used incorrect iterator. (Closes #52)
[HotFix] Version 4.0.2
Version 4.0.0 Release 🥳🥳🥳
Version 4.0.0 Is Here
This version was pretty much a complete rewrite of the entire library from the ground up.
PLEASE NOTE THIS IS A NON-BACKWARDS COMPATIBLE RELEASE
Please read the documentation at https://monogameaseprite.net to get started.
Versin 3.1.1 Release
This release is a quick hotfix to resolve the following issues
AnimatedSprite.Width
andAnimatedSprite.Height
both now take theScale
value into account before returning the value.AnimatedSprite.TryGetCurrentFrameSlice
now takes the scale value into when creating theSliceKey
value.
Get via nuget dotnet add package MonoGame.Aseprite --version 3.1.1
Version 3.1.0 Released
This add support for .NET 6.0 and MonoGame 3.8.1
Going forward, this will only support the current .NET version and current MonoGame version.
Get via nuget dotnet add package MonoGame.Aseprite --version 3.1.0
Version 2.0.5 Released
This release is a quick hotfix to resolve issue #31: Alpha Premultiply Not Applied. When generating Color
values, they are done so using alpha premultiplication. This is to align with the default expectation in MonoGame. When calling SpriteBatch.Begin()
the default constructor and average user will not be specifying a BlendState
so by default premultiplied is expected.
Please refer to the documentation website for how to use this library.
What's Changed
- Updated version number by @manbeardgames in #23
- Premultiply Alpha Added by @AristurtleDev in #33
- Updated links and copyright year in README.md by @AristurtleDev in #34
New Contributors
- @AristurtleDev made their first contribution in #33
Full Changelog: 2.0.4.1...2.0.5
Version 2.0.4.1 Release
This marks the release of version 2.0.4.1.
Change Log
- Fixed issue where
OnAnimationEnd
was invoked during theAnimatedSprite.Stop()
method, but was not properly checked fornull
before invoking. (reference issue #21)
Please refer to the documentation website for installation, migration, and usage documentation.
Version 2.0.3 Release
This marks the release of version 2.0.3. Please refer to the documentation website for installation, migration, and usage documentation.
2.0.2-beta Release
With the 2.0.2-beta release, support for MonoGame 3.7.1 (.NET Framework >= 4.5) has been added.
Please refer to the documentation site for how to install and use update at
https://manbeardgames.com/monogame-aseprite
2.0 Alpha Build
Currently documentation hasn't been written for the 2.0 release. The following serves as a quickstart guide
Quick Start Guide
Download
Download the MonoGame.Aseprite.2.0-alpha.zip
file below. It contains the Monogame.Aseprite.dll
and MonoGame.Aseprite.ContentPipeline.dll
files. Extract these somewhere on you computer where you can remember
Alternatively you can clone the repo and build it yourself. To do this, you'll need to ensure you're in the tags/2.0-alpha
of the repo. The following commands should do it all for you
- Clone the repository with:
git clone https://github.com/manbeardgames/monogame-aseprite.git
cd
to the repo directory with:cd monogame-aseprite
- Switch to the 2.0-alpha tree with:
git checkout tags/2.0-alpha
You'll get a message about the HEAD being detached. This is normal - Initialize the submodules with:
git submodule update --init
Add Pipeline Reference
- Open the
Content.mgcb
file for your project with the Content Pipeline Tool. - In the Content Pipeline Tool, click "Content" in the project panel.
- Scroll down to "References" in the Properties panel and click it to open the Reference Editor dialog
- Click the "Add" button and locate the
MonoGame.Aseprite.ContentPipeline.dll
file to add it. - Click Ok.
Add Project Reference
With your project open in Visual Studio:
- Right-click your project in the Solution Explorer panel and select Add > Project Reference. This may just be Add > Reference... if using VS 2017. This will open the Reference Manager dialog window.
- Click the Browse button at the bottom
- Navigate to and select the
MonoGame.Aseprite.dll
file to add it. - Once added, click OK to close the Reference Manager dialog window.
Using MonoGame.Aseprite
To use this tool, first add a new .ase/.aseprite file to your project using the Content Pipeline tool. When you select the file in the content pipeline tool, you should see in the Properties panel that it is using the Aseprite Animation Importer and Aseprite Animation Procesor for the importer and processor respectively. Click the save button and you can close the pipeline tool now.
In your project, to load the content in, you do so like any other content, with the following command
// Lets say we added the file player_animations.aseprite
AsepriteDocument doc = Content.Load<AsepriteDocument>("player_animations");
Doing this will create the AsperiteDocument
object that has all the information from importing the aseprite file, including a Texture2D
that you can use for rendering. The texture that is generated is a spritesheet of all the frames from the aseprite file. To get the boundries of the frames within the spritesheet, you can use the AsepriteDocument.Frames
property. If you aseprite file had animation tags defined, they are in the AsepriteDocument.Tags
property, which is a Dictionary where the key is the name of the animation.
MonoGame.Aseprite also come with an out-of-the-box AnimatedSprite
class that you can use to create animated sprites from the AsepriteDocment. To use this, just pass the document into a new instance of the class like so
AsepriteDocument doc = Content.Load<AsepriteDocument>("player_animations");
AnimatedSprite _sprite = new AniamtedSprite(doc);
Note that for theAnimatedSprite class to function properly, you have to create animation tags in the Aseprite file as it relies on this to parse correctly. For more information, see the Aseprite documentation at https://www.aseprite.org/docs/tags/
Then when you want a certain animation to play, just use the .Play(string)
method, and give it the name of an animation tag from your file.
sprite.Play("animation_tag_name");
Take a look at the AnimatedSprite class to see what properties and methods are available.
You can also take a look at the monoagem-aseprite-demo project to see a working example of some of the things you can do.