Examples of findRegions()


Examples of com.badlogic.gdx.graphics.g2d.TextureAtlas.findRegions()

  public TileAtlas (TiledMap map, FileHandle inputDir) {
    // TODO: Create a constructor that doesn't take a tmx map,
    for (TileSet set : map.tileSets) {
      FileHandle packfile = getRelativeFileHandle(inputDir, removeExtension(set.imageName) + " packfile");
      TextureAtlas textureAtlas = new TextureAtlas(packfile, packfile.parent(), false);
      List<AtlasRegion> atlasRegions = textureAtlas.findRegions(removeExtension(removePath(set.imageName)));

      for (AtlasRegion reg : atlasRegions) {
        regionsMap.put(reg.index + set.firstgid, reg);
        if (!textures.contains(reg.getTexture())) {
          textures.add(reg.getTexture());
View Full Code Here

Examples of com.badlogic.gdx.graphics.g2d.TextureAtlas.findRegions()

    ResourceManager.loadResource("missile_score", new Texture("items/missile_score.png"));
   
    // Animaciones
        atlas = new TextureAtlas(Gdx.files.internal("ship/ship.pack"));
        ResourceManager.loadResource("ship", atlas);
    ResourceManager.loadResource("ship", new Animation(0.15f, atlas.findRegions("ship")));

        // Animación de nave pequeña
        atlas = new TextureAtlas(Gdx.files.internal("enemy/small.pack"));
    ResourceManager.loadResource("small_enemy", new Animation(0.15f, atlas.findRegions("small")));
        // Animación para la roca
View Full Code Here

Examples of com.badlogic.gdx.graphics.g2d.TextureAtlas.findRegions()

        ResourceManager.loadResource("ship", atlas);
    ResourceManager.loadResource("ship", new Animation(0.15f, atlas.findRegions("ship")));

        // Animación de nave pequeña
        atlas = new TextureAtlas(Gdx.files.internal("enemy/small.pack"));
    ResourceManager.loadResource("small_enemy", new Animation(0.15f, atlas.findRegions("small")));
        // Animación para la roca
        atlas = new TextureAtlas(Gdx.files.internal("enemy/stone.pack"));
    ResourceManager.loadResource("stone", new Animation(0.15f, atlas.findRegions("stone")));

    ResourceManager.loadResource("pursuer_enemy", ResourceManager.createAnimationFromSpriteSheet("enemy/pursuer.png", 6));
View Full Code Here

Examples of com.badlogic.gdx.graphics.g2d.TextureAtlas.findRegions()

        // Animación de nave pequeña
        atlas = new TextureAtlas(Gdx.files.internal("enemy/small.pack"));
    ResourceManager.loadResource("small_enemy", new Animation(0.15f, atlas.findRegions("small")));
        // Animación para la roca
        atlas = new TextureAtlas(Gdx.files.internal("enemy/stone.pack"));
    ResourceManager.loadResource("stone", new Animation(0.15f, atlas.findRegions("stone")));

    ResourceManager.loadResource("pursuer_enemy", ResourceManager.createAnimationFromSpriteSheet("enemy/pursuer.png", 6));
    ResourceManager.loadResource("shooter_enemy", ResourceManager.createAnimationFromSpriteSheet("enemy/shooter.png", 6));
    ResourceManager.loadResource("big_enemy", ResourceManager.createAnimationFromSpriteSheet("enemy/big.png", 6));
    ResourceManager.loadResource("missile", ResourceManager.createAnimationFromSpriteSheet("items/missile.png", 16));
View Full Code Here

Examples of com.badlogic.gdx.graphics.g2d.TextureAtlas.findRegions()

    ResourceManager.loadResource("shooter_enemy", ResourceManager.createAnimationFromSpriteSheet("enemy/shooter.png", 6));
    ResourceManager.loadResource("big_enemy", ResourceManager.createAnimationFromSpriteSheet("enemy/big.png", 6));
    ResourceManager.loadResource("missile", ResourceManager.createAnimationFromSpriteSheet("items/missile.png", 16));
        // Animación para las explosiones
        atlas = new TextureAtlas(Gdx.files.internal("explosion/explosion.pack"));
    ResourceManager.loadResource("explosion", new Animation(0.15f, atlas.findRegions("explosion")));

    //ResourceManager.loadResource("block", new SpriteSheet(new Image("res/items/blocks1.png"), 32, 32, 2, 2));

    // Sonidos
    ResourceManager.loadResource("shoot", Gdx.audio.newSound(Gdx.files.internal("sounds/disparo.mp3")));
View Full Code Here

Examples of com.badlogic.gdx.graphics.g2d.TextureAtlas.findRegions()

    idleRight = atlas.findRegion("mario_idle_right");
    walkLeft = atlas.findRegion("mario_walk_left", 1);
    walkRight = atlas.findRegion("mario_walk_right", 1);
   
    // Crea la animación para correr hacia la derecha
    rightAnimation = new Animation(0.15f, atlas.findRegions("mario_walk_right"));
   
    // Crea la animación para correr hacia la izquierda
    leftAnimation = new Animation(0.15f, atlas.findRegions("mario_walk_left"));
  }
 
View Full Code Here

Examples of com.badlogic.gdx.graphics.g2d.TextureAtlas.findRegions()

   
    // Crea la animación para correr hacia la derecha
    rightAnimation = new Animation(0.15f, atlas.findRegions("mario_walk_right"));
   
    // Crea la animación para correr hacia la izquierda
    leftAnimation = new Animation(0.15f, atlas.findRegions("mario_walk_left"));
  }
 
  /**
   * Pinta la animación en pantalla
   */
 
View Full Code Here

Examples of com.badlogic.gdx.graphics.g2d.TextureAtlas.findRegions()

      props.put("tilewidth", tilewidth);
      props.put("tileheight", tileheight);
      props.put("margin", margin);
      props.put("spacing", spacing);

      for (AtlasRegion region : atlas.findRegions(regionsName)) {
        // handle unused tile ids
        if (region != null) {
          StaticTiledMapTile tile = new StaticTiledMapTile(region);
          int tileid = firstgid + region.index;
          tile.setId(tileid);
View Full Code Here

Examples of com.badlogic.gdx.graphics.g2d.TextureAtlas.findRegions()

      props.put("tilewidth", tilewidth);
      props.put("tileheight", tileheight);
      props.put("margin", margin);
      props.put("spacing", spacing);

      Array<AtlasRegion> regions = atlas.findRegions(regionsName);
      for (AtlasRegion region : regions) {
        // handle unused tile ids
        if (region != null) {
          StaticTiledMapTile tile = new StaticTiledMapTile(region);
View Full Code Here

Examples of com.badlogic.gdx.graphics.g2d.TextureAtlas.findRegions()

      props.put("tilewidth", tilewidth);
      props.put("tileheight", tileheight);
      props.put("margin", margin);
      props.put("spacing", spacing);

      Array<AtlasRegion> regions = atlas.findRegions(regionsName);
      for (AtlasRegion region : regions) {
        // handle unused tile ids
        if (region != null) {
          StaticTiledMapTile tile = new StaticTiledMapTile(region);
View Full Code Here
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.