Adding images and creating textures


show more Adding images and creating textures 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 ...

Adding images and creating textures

So the first type of asset that I'm going to show you how to include is a simple image asset. So in our game we have a background which consists of some stars, and that's just a simple PNG file. If we look in our assets folder, it's called sky.png and that's what it looks like. So we're going to want to embed this so that we can use it in our game. So the way we embed a PNG or any other type of image asset, and you're used to this if you've been doing Flash for a while, is to use the Embed Metadata.

So we can say Embed and then give a source property and give it the path to the PNG file that we want to include. Well that's in the assets folder, and it's called sky.png. And then next we need to give a class which is going to be used to instantiate that image. So again, we're doing everything as static, but this is going to be a private static var sky and this is going to be of type Class.

Now when we're dealing with images, we're actually goin...

Adding images and creating textures
Video duration: 3m 24s 2h 57m Intermediate

Viewers:

Adding images and creating textures provides you with in-depth training on Developer. Taught by Lee Brimelow as part of the Building Flash Games with Starling

please wait ...