Implementing asset management with loading textures and tile-based maps
The next class to review is Utility
, which can be found at core/src/com/packtpub/libgdx/bludbourne/Utility.java
. The Utility
class represents a placeholder for various methods including dealing with the loading and unloading of game assets.
Utility
The class diagram for Utility
(Figure 7) shows the attributes and method signatures for our implementation:
The import packages for Utility
are as follows:
package com.packtpub.libgdx.bludbourne; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.assets.loaders.TextureLoader; import com.badlogic.gdx.assets.loaders.resolvers.InternalFileHandleResolver; import com.badlogic.gdx.maps.tiled.TiledMap; import com.badlogic.gdx.maps.tiled.TmxMapLoader; import com.badlogic.gdx.assets.AssetManager;
Since LibGDX is built upon OpenGL, we need to understand some nomenclature from OpenGL in order to properly understand how certain classes work...