ToolBX.Spritebound
3.0.0
dotnet add package ToolBX.Spritebound --version 3.0.0
NuGet\Install-Package ToolBX.Spritebound -Version 3.0.0
<PackageReference Include="ToolBX.Spritebound" Version="3.0.0" />
paket add ToolBX.Spritebound --version 3.0.0
#r "nuget: ToolBX.Spritebound, 3.0.0"
// Install ToolBX.Spritebound as a Cake Addin #addin nuget:?package=ToolBX.Spritebound&version=3.0.0 // Install ToolBX.Spritebound as a Cake Tool #tool nuget:?package=ToolBX.Spritebound&version=3.0.0
Spritebound
Spritesheet and animation management for sprite-based projects.
The base package for Sprites is kept as generic as possible to be allowed to be used with any .NET engine or framework. Specific implementations will likely come eventually.
For now, this base package only includes container classes meant to be used as part of a larger animation system.
Static vs Animated spritesheet
StaticSpritesheets are used for inanimate sprite elements that are bundled under a single file. This could be tilesets, posters, items or UI elements.
AnimatedSpritesheets are used for animated sprite elements such as a character or a special effect.
Spritesheets have an ID property! What do I do with that??
It's up to you and your engine/framework. Jackal uses the ID internally because they are part of a collection and it's faster to look for a numeric ID than compare strings.
It's not ideal (and not very ToolBX-like, I admit) but you could just ignore it.
However, if you do want to use the ID property, the Spritesheet base class implements IAutoIncremented<int>
which is part of the ToolBX.Unicity library. That library has an extension method to automatically "get the next available ID" in an IEnumerable<T> where T implements IAutoIncremented<int>
.
SpritesheetMap
A map to a static spritesheet made up of sprites of equal size. Maps are automatically indexed by row from left to right.
Rough Trigger uses this for country flags and weapon icons among other things.
Events
Sometimes, you might need events to be triggered when a specific frame plays. This is what the FrameEvent
class is there to achieve.
FrameEvent.Name
is used to identify the event in-game. In other words; that name must be the exact same on both ends for it to be recognized.
FrameEvent.Origin
is optionally used when your event also needs a position. This is usually reserved for things like when a gun is fired so that the game knows exactly where it's fired from.
Serialization
Both System.Text.Json and Newtonsoft.Json are tested and supported by default and do not require custom converters.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net8.0
- ToolBX.Collections.ObservableList (>= 3.0.0)
- ToolBX.Mathemancy (>= 3.0.0)
- ToolBX.Unicity (>= 3.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on ToolBX.Spritebound:
Package | Downloads |
---|---|
ToolBX.Spritebound.Web
Spritesheet management for websites. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
3.0.0 | 99 | 9/27/2024 |
3.0.0-beta1 | 87 | 9/23/2024 |
2.2.0 | 188 | 1/13/2024 |
2.2.0-beta1 | 122 | 1/7/2024 |
2.0.5 | 221 | 6/19/2023 |
2.0.4 | 218 | 5/5/2023 |
2.0.3 | 167 | 5/1/2023 |
2.0.2 | 198 | 4/27/2023 |
2.0.1 | 252 | 3/10/2023 |
2.0.1-beta1 | 158 | 3/3/2023 |
2.0.0 | 378 | 11/12/2022 |
2.0.0-beta1 | 157 | 10/4/2022 |
1.0.4 | 411 | 10/4/2022 |
1.0.3 | 523 | 8/10/2022 |
1.0.2 | 529 | 8/7/2022 |
1.0.1 | 633 | 7/22/2022 |
1.0.0 | 415 | 7/3/2022 |