Package com.badlogic.gdx.assets

Examples of com.badlogic.gdx.assets.AssetDescriptor


        for (Element property : properties.getChildrenByName("property")) {
          String name = property.getAttribute("name");
          String value = property.getAttribute("value");
          if (name.startsWith("atlas")) {
            FileHandle atlasHandle = getRelativeFileHandle(tmxFile, value);
            dependencies.add(new AssetDescriptor(atlasHandle, TextureAtlas.class));
          }
        }
      }
    } catch (IOException e) {
      throw new GdxRuntimeException("Unable to parse .tmx file.");
View Full Code Here


  public Array<AssetDescriptor> getDependencies (String fileName, FileHandle tmxFile, Parameters parameter) {
    Array<AssetDescriptor> dependencies = new Array<AssetDescriptor>();
    try {
      root = xml.parse(tmxFile);
      for (FileHandle image : loadTileSheets(root, tmxFile)) {
        dependencies.add(new AssetDescriptor(image.path(), Texture.class));
      }
      return dependencies;
    } catch (IOException e) {
      throw new GdxRuntimeException("Couldn't load tilemap '" + fileName + "'", e);
    }
View Full Code Here

      if (!resolve(assetData.filename).exists()){
        assetData.filename = file.parent().child(Gdx.files.absolute(assetData.filename).name()).path();
      }

      if(assetData.type == ParticleEffect.class){
        descriptors.add(new AssetDescriptor(assetData.filename, assetData.type, parameter));
      }
      else
        descriptors.add(new AssetDescriptor(assetData.filename, assetData.type));
    }
   
    return descriptors;
   
  }
View Full Code Here

    }
   
    public AssetDescriptor loadAsset(){
      if(loadIndex == assets.size) return null;
      AssetData data = (AssetData)resources.sharedAssets.get(assets.get(loadIndex++));
      return new AssetDescriptor(data.filename, data.type);
    }
View Full Code Here

      if (parameter != null) {
        texParams.minFilter = parameter.textureMinFilter;
        texParams.magFilter = parameter.textureMagFilter;
      }
      for (FileHandle image : loadTilesets(root, tmxFile)) {
        dependencies.add(new AssetDescriptor(image, Texture.class, texParams));
      }
      return dependencies;
    } catch (IOException e) {
      throw new GdxRuntimeException("Couldn't load tilemap '" + fileName + "'", e);
    }
View Full Code Here

  }
 
  @Override
  public void load (AssetManager manager, ResourceData data) {
    SaveData saveData = data.getSaveData();
    AssetDescriptor descriptor = saveData.loadAsset();
    if(descriptor!=null){
      Model model = (Model) manager.get(descriptor);
      setMesh(model.meshes.get((Integer)saveData.load("index")), model);
    }
  }
View Full Code Here

 
  @Override
  public void load (AssetManager manager, ResourceData resources) {
    SaveData data = resources.getSaveData();
    Array<Array<Integer>>effectsIndices = data.load("indices");
    AssetDescriptor descriptor;
    Iterator<Array<Integer>> iterator = effectsIndices.iterator();
    while((descriptor = data.loadAsset()) != null){
      ParticleEffect effect = (ParticleEffect)manager.get(descriptor);
      if(effect == null)
        throw new RuntimeException("Template is null");
View Full Code Here

  }
 
  @Override
  public void load (AssetManager manager, ResourceData resources) {
    SaveData data = resources.getSaveData();
    AssetDescriptor descriptor;
    while((descriptor = data.loadAsset()) != null){
      Model model = (Model)manager.get(descriptor);
      if(model == null)
        throw new RuntimeException("Model is null");
      models.add(model);
View Full Code Here

    Array<AssetDescriptor> deps = new Array();
    TextureParameter textureParam = new TextureParameter();
    textureParam.minFilter = TextureFilter.Linear;
    textureParam.magFilter = TextureFilter.Linear;
    if (parameter == null)
      deps.add(new AssetDescriptor(Gdx.files.internal(fileName).nameWithoutExtension() + ".png", Texture.class, textureParam));
    else
      deps.add(new AssetDescriptor(parameter.texturePath, Texture.class, textureParam));
    return deps;
  }
View Full Code Here

TOP

Related Classes of com.badlogic.gdx.assets.AssetDescriptor

Copyright © 2018 www.massapicom. 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.