Creating the main texture atlas


show more Creating the main texture atlas provides you with in-depth training on Developer. Taught by Lee Brimelow as part of the Building Flash Games with Starling show less
please wait ...

Creating the main texture atlas

So now that we've created our main sprite sheet in TexturePacker, we need to use both the PNG and the XML file to create a texture atlas, so that we can reference those assets in Starling. So I'm going to come into my asset class right under where I created or embedded the sky.png and we need to embed both that atlas.png and also the atlas.xml. So I'm going to start with the PNG. So Embed source and that is assets/atlas.png and I'm going to create a private static variable which is going to hold a class variable so we can instantiate that.

So it's going to be private static var and I'm just going to call it atlas. Now when we create our texture atlas, I want to create that as a public static variable, so that we can actually reference it from anywhere we want in our game. So I'm going to create another variable here public static var, and I'm going to call it ta for TextureAtlas, and this is going to be of type TextureAtlas. So now I need to embed that XML ...

Creating the main texture atlas
Video duration: 3m 29s 2h 57m Intermediate

Viewers:

Creating the main texture atlas provides you with in-depth training on Developer. Taught by Lee Brimelow as part of the Building Flash Games with Starling

please wait ...