Package com.netthreads.libgdx.texture

Source Code of com.netthreads.libgdx.texture.TextureAssetManager

package com.netthreads.libgdx.texture;

import com.badlogic.gdx.assets.AssetManager;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.utils.Disposable;
import com.google.inject.Inject;
import com.google.inject.Singleton;

@Singleton
public class TextureAssetManager implements Disposable
{
  private AssetManager assetManager;
 
  @Inject
  public TextureAssetManager(TextureDefinitions textureDefinitions)
  {
    assetManager = new AssetManager();
   
    for (TextureDefinition textureDefinition : textureDefinitions.getDefinitions())
    {
      assetManager.load(textureDefinition.getPath(), Texture.class);
    }
  }
 
  public AssetManager getAssetManager()
  {
    return assetManager;
  }
 
  @Override
  public void dispose()
  {
    assetManager.dispose();
  }
 
}
TOP

Related Classes of com.netthreads.libgdx.texture.TextureAssetManager

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.