Package com.badlogic.gdx.graphics

Examples of com.badlogic.gdx.graphics.Texture


    float scaleX, float scaleY, float rotation) {
    if (!drawing) throw new IllegalStateException("SpriteBatch.begin must be called before draw.");

    float[] vertices = this.vertices;

    Texture texture = region.texture;
    if (texture != lastTexture) {
      switchTexture(texture);
    } else if (idx == vertices.length) //
      flush();
View Full Code Here


    float scaleX, float scaleY, float rotation, boolean clockwise) {
    if (!drawing) throw new IllegalStateException("SpriteBatch.begin must be called before draw.");

    float[] vertices = this.vertices;

    Texture texture = region.texture;
    if (texture != lastTexture) {
      switchTexture(texture);
    } else if (idx == vertices.length) //
      flush();
View Full Code Here

  public Texture load (String fileName);

  public static class FileTextureProvider implements TextureProvider {
    @Override
    public Texture load (String fileName) {
      Texture result = new Texture(Gdx.files.internal(fileName));
      result.setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear);
      result.setWrap(Texture.TextureWrap.Repeat, Texture.TextureWrap.Repeat);
      return result;
    }
View Full Code Here

  }

  private void load (TextureAtlasData data) {
    ObjectMap<Page, Texture> pageToTexture = new ObjectMap<Page, Texture>();
    for (Page page : data.pages) {
      Texture texture = null;
      if (page.texture == null) {
        texture = new Texture(page.textureFile, page.format, page.useMipMaps);
        texture.setFilter(page.minFilter, page.magFilter);
        texture.setWrap(page.uWrap, page.vWrap);
      } else {
        texture = page.texture;
        texture.setFilter(page.minFilter, page.magFilter);
        texture.setWrap(page.uWrap, page.vWrap);
      }
      textures.add(texture);
      pageToTexture.put(page, texture);
    }
View Full Code Here

  /** Creates a BitmapFont from a BMFont file, using the specified image for glyphs. Any image specified in the BMFont file is
   * ignored.
   * @param flip If true, the glyphs will be flipped for use with a perspective where 0,0 is the upper left corner.
   * @param integer If true, rendering positions will be at integer values to avoid filtering artifacts. */
  public BitmapFont (FileHandle fontFile, FileHandle imageFile, boolean flip, boolean integer) {
    this(new BitmapFontData(fontFile, flip), new TextureRegion(new Texture(imageFile, false)), integer);
    ownsTexture = true;
  }
View Full Code Here

    if (regions == null || regions.length == 0) {
      // load each path
      this.regions = new TextureRegion[data.imagePaths.length];
      for (int i = 0; i < this.regions.length; i++) {
        if (data.fontFile == null) {
          this.regions[i] = new TextureRegion(new Texture(Gdx.files.internal(data.imagePaths[i]), false));
        } else {
          this.regions[i] = new TextureRegion(new Texture(Gdx.files.getFileHandle(data.imagePaths[i], data.fontFile.type()),
            false));
        }
      }
      ownsTexture = true;
    } else {
View Full Code Here

    addManagedFrameBuffer(Gdx.app, this);
  }

  /** Override this method in a derived class to set up the backing texture as you like. */
  protected void setupTexture () {
    colorTexture = new Texture(width, height, format);
    colorTexture.setFilter(TextureFilter.Linear, TextureFilter.Linear);
    colorTexture.setWrap(TextureWrap.ClampToEdge, TextureWrap.ClampToEdge);
  }
View Full Code Here

      this.convertObjectToTileSpace = parameters.convertObjectToTileSpace;
      FileHandle tmxFile = resolve(fileName);
      root = xml.parse(tmxFile);
      ObjectMap<String, Texture> textures = new ObjectMap<String, Texture>();
      for (FileHandle textureFile : loadTilesets(root, tmxFile)) {
        Texture texture = new Texture(textureFile, parameters.generateMipMaps);
        texture.setFilter(parameters.textureMinFilter, parameters.textureMagFilter);
        textures.put(textureFile.path(), texture);
      }
      DirectImageResolver imageResolver = new DirectImageResolver(textures);
      TiledMap map = loadTilemap(root, tmxFile, imageResolver);
      map.setOwnedResources(textures.values().toArray());
View Full Code Here

      emitter.setSprite(new Sprite(loadTexture(imagesDir.child(imageName))));
    }
  }

  protected Texture loadTexture (FileHandle file) {
    return new Texture(file, false);
  }
View Full Code Here

    public SplashScreen(Bombermanx game) {
        this.game = game;

        Texture.setEnforcePotImages(false);
        splashTexture = new Texture(Gdx.files.internal("ui/splash.png"));
        splashImage = new Image(splashTexture);
        stage = new Stage();
    }
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.