GoldSrcSprite 1.0.1

Install-Package GoldSrcSprite -Version 1.0.1
dotnet add package GoldSrcSprite --version 1.0.1
<PackageReference Include="GoldSrcSprite" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add GoldSrcSprite --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: GoldSrcSprite, 1.0.1"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install GoldSrcSprite as a Cake Addin
#addin nuget:?package=GoldSrcSprite&version=1.0.1

// Install GoldSrcSprite as a Cake Tool
#tool nuget:?package=GoldSrcSprite&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

GoldSrcSprite

GoldsrcSprite is a simple .NET Standard library to handle GoldSrc engine sprite (.spr) files.

Usage Examples

// Load sprite
var sprite = GoldSrcSprite.FromFile("sprite.spr");

// Get bitmap of the first frame
using(var bmp = sprite.Frames[0].GetBitmap()) {
	// Save as bmp
    bmp.Save("sprite.bmp");
}

// Save sprite
sprite.SaveToFile("sprite.spr");

About .spr files

The format itself is flexible, however keep in mind that game engines might not load the most extreme cases.

  • A sprite can only use 256 colors with it's own palette
  • Can specify how the sprite should be oriented and rendered
  • Each sprite can contain multiple frames
  • Each frame share the same palette
  • Each frame can be different sizes and have a different center origin point

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.1 467 10/14/2018
1.0.0 437 10/14/2018

* Fixed issue when getting bitmap from frame with stride padding