Texture Atlases - Part 1
10 Sep 2021
Texture Atlases - Part 1 Introduction This tutorial is kind of a long one, so I’ve broken it up into three separate pages. On this first page, we will look at what a texture atlas is, and how it can be used, as well as preparing our content for the rest of the tutorial. On the second page, we will create a class that will handle a texture atlas, and finally, on the third page, we will use this class to do 2D animation with a texture atlas.
Texture Atlases - Part 2
10 Sep 2021
Texture Atlases - Part 2 Creating an AnimatedSprite Class In this part of the tutorial, we are going to create a class that will handle the texture atlas, and take care of the drawing for us. Creating the Class To create a new class, right-click on your project in the Solution Explorer, and choose Add > New Item from the popup menu. The Add New Item dialog will appear. Select the Class template, and change the name (near the bottom) to AnimatedSprite.
Texture Atlases - Part 3
10 Sep 2021
Texture Atlases - Part 3 Using Our AnimatedSprite Class We will now go back to our main game class and draw an animated sprite with our new AnimatedSprite class that we created in Part 2. Go back over to your main game class (called Game1.cs by default). We will need to make a few simple changes here to get our animated sprite to draw. First, we will need an instance variable to store our animated sprite, so add the following code as an instance variable in your game class: