Getting started with TexturePacker and MonoGame

This overview shows you how to create your first sprite sheet and import it into your MonoGame project.

These 6 steps will cost you only 5 minutes - but make your development much easier. Promised!

Open TexturePacker, select MonoGame as framework.

TexturePacker: Select MonoGame as framework

Add sprites ...

Drag & drop sprites
onto TexturePacker.

... or folders

TexturePacker adds
all sprites inside the folder
and updates the texture
when the content changes.

Add Sprites to TexturePacker

Set output files
Make sure to set the output path of your data and texture file inside the Contents folder of your MonoGame project and the class file within your app's source tree.

Set the output path for your files

Optional: Set Trim mode and Pivot Point
Crop removes transparency from sprites, allowing a better packing ratio.

TexturePacker allows you to set a Pivot Point and Trim your sprite

Click Publish sprite sheet to write the sprite sheet to your MonoGame project.

TexturePacker: Click Publish sprite sheet


Sprite Sheet Loader
Instantiate a new instance of the SpriteSheetLoader class.

var spriteSheetLoader = new SpriteSheetLoader(this.Content);
this.spriteSheet = spriteSheetLoader.Load("CapGuyDemo.png");

Instantiate SpriteRender
in your LoadContent method

this.spriteBatch = new SpriteBatch(GraphicsDevice);
this.spriteRender = new SpriteRender(this.spriteBatch);


And then in your Draw method render your frames like this using the class file to check file names at compile time:


    new Vector2(350, 530));


Do you want to read more?

Head over to our MonoGame tutorials section.

Do you have any feedback or questions?

By clicking 'Submit' you agree that the data entered above is sent to and stored by CodeAndWeb GmbH for the purpose of answering your request. The data is transmitted through an encrypted internet connection and processed according to our privacy policy. You can withdraw your consent at any time with effect for the future.