Game Development Reference
In-Depth Information
Gdx.app.debug(TAG, "asset: " + a);
TextureAtlas atlas =
assetManager.get(Constants.TEXTURE_ATLAS_OBJECTS);
// enable texture filtering for pixel smoothing
for (Texture t : atlas.getTextures())
t.setFilter(TextureFilter.Linear, TextureFilter.Linear);
// create game resource objects
fonts = new AssetFonts();
bunny = new AssetBunny(atlas);
rock = new AssetRock(atlas);
goldCoin = new AssetGoldCoin(atlas);
feather = new AssetFeather(atlas);
levelDecoration = new AssetLevelDecoration(atlas);
}
@Override
public void dispose () {
assetManager.dispose();
fonts.defaultSmall.dispose();
fonts.defaultNormal.dispose();
fonts.defaultBig.dispose();
}
The added code includes a new inner class called AssetFonts that holds the default
bitmap font in three differently configured sizes. The size is configured by scaling
the font either up or down. Bitmap fonts must be disposed manually so that the
corresponding calls are added to the dispose() method.
 
Search WWH ::




Custom Search