Class TexturePacker

java.lang.Object
tripleplay.util.TexturePacker

public class TexturePacker extends Object
A runtime texture packer.
  • Constructor Details

    • TexturePacker

      public TexturePacker()
  • Method Details

    • add

      public TexturePacker add(String id, Tile tile)
      Add an image to the packer.
    • add

      public TexturePacker add(String id, float width, float height, TexturePacker.Renderer renderer)
      Add a lazily rendered region to the packer. The renderer will be used to draw the region each time pack() is called.
    • pack

      public Map<String,Tile> pack(Graphics gfx, QuadBatch batch)
      Pack all images into as few atlases as possible.
      Returns:
      A map containing the new images, keyed by the id they were added with.