Package com.badlogic.gdx.graphics

Examples of com.badlogic.gdx.graphics.Texture


  public synchronized void updateTextureAtlas (TextureAtlas atlas, TextureFilter minFilter, TextureFilter magFilter,
    boolean useMipMaps) {
    for (Page page : pages) {
      if (page.texture == null) {
        if (page.rects.size != 0 && page.addedRects.size > 0) {
          page.texture = new Texture(new ManagedPixmapTextureData(page.image, page.image.getFormat(), useMipMaps)) {
            @Override
            public void dispose () {
              super.dispose();
              getTextureData().consumePixmap().dispose();
            }
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.s */
  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 {
      this.regions = regions;
View Full Code Here

  public void draw (TextureRegion region, float x, float y, float width, float height) {
    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) {
    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

    final short[] regionTriangles = region.triangles;
    final int regionTrianglesLength = regionTriangles.length;
    final float[] regionVertices = region.vertices;
    final int regionVerticesLength = regionVertices.length;

    final Texture texture = region.region.texture;
    if (texture != lastTexture)
      switchTexture(texture);
    else if (triangleIndex + regionTrianglesLength > triangles.length || vertexIndex + regionVerticesLength > vertices.length)
      flush();
View Full Code Here

    final int regionTrianglesLength = regionTriangles.length;
    final float[] regionVertices = region.vertices;
    final int regionVerticesLength = regionVertices.length;
    final TextureRegion textureRegion = region.region;

    final Texture texture = textureRegion.texture;
    if (texture != lastTexture)
      switchTexture(texture);
    else if (triangleIndex + regionTrianglesLength > triangles.length || vertexIndex + regionVerticesLength > vertices.length)
      flush();
View Full Code Here

    final int regionTrianglesLength = regionTriangles.length;
    final float[] regionVertices = region.vertices;
    final int regionVerticesLength = regionVertices.length;
    final TextureRegion textureRegion = region.region;

    Texture texture = textureRegion.texture;
    if (texture != lastTexture)
      switchTexture(texture);
    else if (triangleIndex + regionTrianglesLength > triangles.length || vertexIndex + regionVerticesLength > vertices.length)
      flush();
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.