Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Assets implements Disposable, AssetErrorListener {
- public static final Assets instance = new Assets();
- private AssetManager assetManager;
- public AssetPlayItems playItems;
- public Skin skinGameUI;
- public void initQueue (AssetManager assetManager) {
- this.assetManager = assetManager;
- // set asset manager error handler
- assetManager.setErrorListener(this);
- // load texture atlas
- assetManager.load(Constants.TEXTURE_PLAY_GAME, TextureAtlas.class);
- //load skins
- assetManager.load(Constants.SKIN_GAME_UI, Skin.class, new SkinLoader.SkinParameter(Constants.TEXTURE_GAME_UI));
- //load spine
- assetManager.load(Constants.SKELETON_DATA, SkeletonData.class);
- assetManager.load(Constants.TEXTURE, TextureAtlas.class);
- }
- public void get(){
- assetManager.finishLoading();
- TextureAtlas atlasPlayMain = assetManager.get(Constants.TEXTURE_PLAY_GAME);
- skinGameUI = assetManager.get(Constants.SKIN_GAME_UI);
- TextureAtlas atlas = assetManager.get(Constants.TEXTURE);
- //SkeletonData skeletonData = assetManager.get(Constants.SKELETON_DATA);
- // enable texture filtering for pixel smoothing
- for (Texture t : atlasPlayMain.getTextures()) {
- t.setFilter(TextureFilter.Linear, TextureFilter.Linear);
- }
- playItems = new AssetPlayItems(atlasPlayMain);
- }
- public class AssetPlayItems {
- public final AtlasRegion levelBackground;
- public AssetPlayItems (TextureAtlas atlas) {
- levelBackground = atlas.findRegion("background");
- }
- }
- @Override
- public void dispose() {
- assetManager.dispose();
- }
- @Override
- public void error(AssetDescriptor asset, Throwable throwable) {
- }
- }
- assetManager.load(Constants.SKELETON_DATA_DIGGI, SkeletonData.class);
- exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: No loader for type: SkeletonData
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement