Gideros Mobile Game Development by Desconocido

Gideros Mobile Game Development by Desconocido

Format: epub

Using texture packs inside project

So now when we have our textures packed, how do we use them in our Gideros project? First we need to create the texturepacks directory in Gideros Studio and add both the files (LevelScene.png and LevelScene.txt) to this folder.

Then let's load them using the TexturePack class and save it as self.g, an instance property of our scene instance. We can do that by creating an instance of the TexturePack class and providing path to file with information about texture and path to file, which is a texture pack itself. We also provide the third parameter as true, to indicate that we want to smooth our textures when scaling. Add the following code line to the LevelScene:init() method:

self.g = TexturePack.new("texturepacks/LevelScene.txt", "texturepacks/LevelScene.png", true)


Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.