Summary
Over the course of this chapter we have learned about textures, co-ordinate systems, and fonts. We've learned some techniques that game developers use to put images and text onto the screen while maximizing performance, and we've actually gone and taken the first steps by drawing some images and writing some text to the screen.
By now you should know what DXT is and how to load these files from the disk using DirectXTK. You also know how to take these textures and draw them onto the screen with DirectXTK's SpriteBatch
.
Don't forget that SpriteBatch
offers a lot of benefits when you really get into drawing many things onto the screen, by batching the textures together for performance and offering sorting functionality so you can make the most of transparency.
Text rendering is a necessity for most games, and you now know how to take a font, pre-process it so you can save time at runtime, and write characters to the screen. We even covered how to apply a color tint to the text to make it more interesting.
You now know the basics of 2D rendering and are ready to apply them in making a game. There are plenty of other things you can do to make your game look awesome, so if you're interested in really pushing your 2D rendering skills, look around the many game development resources online and make some beautiful games.
Next steps
Now that we know how to get something onto the screen, we're ready to start turning this into a game. There are many more systems that contribute to the game, and the next chapter will cover some of them, with a heavy focus on getting some gameplay in there so we can take this from some static pictures to an interactive game.