Package com.badlogic.gdx.graphics

Examples of com.badlogic.gdx.graphics.Texture


    return blur.getAmount();
  }

  @Override
  public void render (final FrameBuffer src, final FrameBuffer dest) {
    Texture texsrc = src.getColorBufferTexture();

    boolean blendingWasEnabled = PostProcessor.isStateEnabled(GL20.GL_BLEND);
    Gdx.gl.glDisable(GL20.GL_BLEND);

    pingPongBuffer.begin();
View Full Code Here


  // graphics

  public static Texture newTexture( String name, boolean mipMap ) {
    long hash = Hash.APHash( name );
    Texture t = textureCache.get( hash );

    if( t != null ) {
      Gdx.app.log( "ResourceFactory", "Cache hit for \"" + name + "\"" );
      // cache hit
      return t;
    }

    t = new Texture( Gdx.files.internal( "data/" + name ), Format.RGBA8888, mipMap );

    if( mipMap ) {
      t.setFilter( TextureFilter.MipMapLinearNearest, TextureFilter.Nearest );
    } else {
      t.setFilter( TextureFilter.Nearest, TextureFilter.Nearest );
    }

    textures.add( t );
    textureCache.put( hash, t );
View Full Code Here

      data.regions = new TextureRegion[pages.size];

      for (int i = 0; i < pages.size; i++) {
        Page p = pages.get(i);

        Texture tex = new Texture(new PixmapTextureData(p.getPixmap(), p.getPixmap().getFormat(), parameter.genMipMaps,
          false, true)) {
          @Override
          public void dispose () {
            super.dispose();
            getTextureData().consumePixmap().dispose();
          }
        };
        tex.setFilter(parameter.minFilter, parameter.magFilter);

        data.regions[i] = new TextureRegion(tex);
      }
    }
    return data;
View Full Code Here

        TextureAtlas atlas;

    Texture.setEnforcePotImages(false);
    // Imágenes
    ResourceManager.loadResource("background", new Texture("backgrounds/farback.png"));
    ResourceManager.loadResource("ship_bullet", new Texture("ship/bullet.png"));
    ResourceManager.loadResource("shooter_bullet", new Texture("enemy/bullet.png"));
    ResourceManager.loadResource("bomb", new Texture("items/bomb.png"));
    ResourceManager.loadResource("shield", new Texture("items/shield.png"));
   
    // Onscreen information
    ResourceManager.loadResource("bomb_score", new Texture("items/bomb_score.png"));
    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")));
View Full Code Here

   * @param frameCount El número de frames que componen el SpriteSheet
   * @return La animación
   */
  public static Animation createAnimationFromSpriteSheet(String spriteSheetName, int frameCount) {
   
    Texture spriteSheet = new Texture(Gdx.files.internal(spriteSheetName));
    TextureRegion[][] sheetFrames = TextureRegion.split(spriteSheet, spriteSheet.getWidth(), spriteSheet.getHeight() / frameCount);
    TextureRegion[] frames = new TextureRegion[frameCount];
    for (int i = 0; i < frameCount; i++) {
      frames[i] = sheetFrames[i][0];
    }
   
View Full Code Here

    public void create() {
      OrthographicCamera camera = new OrthographicCamera(640, 480);
      camera.position.set(320, 240, 0);
      camera.update();
     
      Texture crateTexture = new Texture("assets/crate.png");
      Texture coinTexture = new Texture("assets/coin.png");
     
      engine = new PooledEngine();
      engine.addSystem(new RenderSystem(camera));
      engine.addSystem(new MovementSystem());
     
View Full Code Here

    this.game = fluidSimulatorStarter;
  }

  private void createWorld() {
    if (IS_DESKTOP) {
      dropTexture = new Texture("data/fluid_drop_red_64.png");
      dropTexture2 = new Texture("data/fluid_drop_blue_64.png");
    }
    dropRadius = 0.1f + dropRadiusK;
    dropRadiusPixel = (int) (dropRadius * PARTICLE_SIZE);
    dropRadiusPixel2 = dropRadiusPixel * dropRadiusPixel;
    if (IS_DESKTOP) {
View Full Code Here

    bgmName = "Naki Oujo no Tame no Septette";
    setQueues();

    // =================Animations

    shipSheet = new Texture(Gdx.files.internal("data/spritesheets/CharacterSheet.png"));
    enemySheet = new Texture(Gdx.files.internal("data/spritesheets/EnemySheet.png"));
    projectileSheet = new Texture(Gdx.files.internal("data/spritesheets/ProjectileSheet.png"));
    bossSheet = new Texture(Gdx.files.internal("data/spritesheets/BossSheet.png"));

    frameTexture = new TextureRegion(new Texture("data/screens/frame.png"));

    // set sprite sheet to work with to shipSheet
    TextureRegion[][] tmp = TextureRegion.split(shipSheet, shipSheet.getWidth() / shipSheetTileWidth * 3,
        shipSheet.getHeight() / shipSheetTileHeight * 3);
    shipFrames = new TextureRegion[3]; // number of frames for the animation
View Full Code Here

  }

  @Override
  public void show() {
    // TODO Auto-generated method stub
    splashTexture = new Texture("data/screens/Untitled.png");
    splashTexture.setFilter(TextureFilter.Linear, TextureFilter.Linear);
    splashSprite = new Sprite(splashTexture);
    splashSprite.setColor(1, 1, 1, 0);
    splashSprite.setX(Gdx.graphics.getWidth() / 2 - (splashSprite.getWidth() / 2));
    splashSprite.setY(Gdx.graphics.getHeight() / 2 - (splashSprite.getHeight() / 2));
View Full Code Here

   
    setQueues();

    // =================Animations

    shipSheet = new Texture(Gdx.files.internal("data/spritesheets/CharacterSheet.png"));
    enemySheet = new Texture(Gdx.files.internal("data/spritesheets/EnemySheet.png"));
    projectileSheet = new Texture(Gdx.files.internal("data/spritesheets/ProjectileSheet.png"));
    bossSheet = new Texture(Gdx.files.internal("data/spritesheets/BossSheet.png"));

    frameTexture = new TextureRegion(new Texture("data/screens/frame.png"));

    // set sprite sheet to work with to shipSheet
    TextureRegion[][] tmp = TextureRegion.split(shipSheet, shipSheet.getWidth() / shipSheetTileWidth * 3,
        shipSheet.getHeight() / shipSheetTileHeight * 3);
    shipFrames = new TextureRegion[3]; // number of frames for the animation
View Full Code Here

TOP

Related Classes of com.badlogic.gdx.graphics.Texture

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.