Package com.badlogic.gdx.utils

Examples of com.badlogic.gdx.utils.Array


  /** Returns all regions in the atlas as sprites. This method creates a new sprite for each region, so the result should be
   * stored rather than calling this method multiple times.
   * @see #createSprite(String) */
  public Array<Sprite> createSprites () {
    Array sprites = new Array(regions.size);
    for (int i = 0, n = regions.size; i < n; i++)
      sprites.add(newSprite(regions.get(i)));
    return sprites;
  }
View Full Code Here


  /** Returns all regions with the specified name as sprites, ordered by smallest to largest {@link AtlasRegion#index index}. This
   * method uses string comparison to find the regions and constructs new sprites, so the result should be cached rather than
   * calling this method multiple times.
   * @see #createSprite(String) */
  public Array<Sprite> createSprites (String name) {
    Array<Sprite> matched = new Array();
    for (int i = 0, n = regions.size; i < n; i++) {
      AtlasRegion region = regions.get(i);
      if (region.name.equals(name)) matched.add(newSprite(region));
    }
    return matched;
  }
View Full Code Here

    DebugRect.pool.freeAll(debugRects);
    debugRects.clear();
  }

  private void addDebugRect (float x, float y, float w, float h, Color color) {
    if (debugRects == null) debugRects = new Array();
    DebugRect rect = DebugRect.pool.obtain();
    rect.color = color;
    rect.set(x, getHeight() - y - h, w, h);
    debugRects.add(rect);
  }
View Full Code Here

  private final Array<ParticleEmitter> emitters;
  private BoundingBox bounds;
  private boolean ownsTexture;

  public ParticleEffect () {
    emitters = new Array(8);
  }
View Full Code Here

  public ParticleEffect () {
    emitters = new Array(8);
  }

  public ParticleEffect (ParticleEffect effect) {
    emitters = new Array(true, effect.emitters.size);
    for (int i = 0, n = effect.emitters.size; i < n; i++)
      emitters.add(new ParticleEmitter(effect.emitters.get(i)));
  }
View Full Code Here

  private synchronized void injectDependency (String parentAssetFilename, AssetDescriptor dependendAssetDesc) {
    // add the asset as a dependency of the parent asset
    Array<String> dependencies = assetDependencies.get(parentAssetFilename);
    if (dependencies == null) {
      dependencies = new Array();
      assetDependencies.put(parentAssetFilename, dependencies);
    }
    dependencies.add(dependendAssetDesc.fileName);

    // if the asset is already loaded, increase its reference count.
View Full Code Here

  @Override
  public Array<AssetDescriptor> getDependencies (String fileName, FileHandle file, ParticleEffectParameter param) {
    Array<AssetDescriptor> deps = null;
    if (param != null && param.atlasFile != null) {
      deps = new Array();
      deps.add(new AssetDescriptor<TextureAtlas>(param.atlasFile, TextureAtlas.class));
    }
    return deps;
  }
View Full Code Here

*/
public class ParticleEffect implements Disposable {
  private final Array<ParticleEmitter> emitters;

  public ParticleEffect () {
    emitters = new Array(8);
  }
View Full Code Here

  public ParticleEffect () {
    emitters = new Array(8);
  }

  public ParticleEffect (ParticleEffect effect) {
    emitters = new Array(true, effect.emitters.size);
    for (int i = 0, n = effect.emitters.size; i < n; i++)
      emitters.add(new ParticleEmitter(effect.emitters.get(i)));
  }
View Full Code Here

    super(resolver);
  }

  @Override
  public Array<AssetDescriptor> getDependencies (String fileName, SkinParameter parameter) {
    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.utils.Array

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.