package com.blarg.gdx.graphics;

import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.utils.Array;

public abstract class TextureAtlas {
	public static final float TEXCOORD_EDGE_BLEED_OFFSET = 0.02f;

	public final Texture texture;

	protected final float edgeCoordOffset;
	protected Array<TextureRegion> tiles = new Array<TextureRegion>(TextureRegion.class);

	public TextureAtlas(Texture texture, float edgeCoordOffset) {
		this.texture = texture;
		this.edgeCoordOffset = edgeCoordOffset;
	}

	public TextureRegion get(int index) {
		return tiles.items[index];
	}

	public int count() {
		return tiles.size;
	}
}

@@ -148,19 +148,136 @@
 gdx.
-utils.Array
+math.MathUtils;%0Aimport com.badlogic.gdx.math.Vector2;%0Aimport com.badlogic.gdx.utils.Array;%0Aimport com.blarg.gdx.math.MathHelpers
 ;%0A%0Ap
@@ -761,24 +761,24 @@
 t count() %7B%0A
-
 %09%09return til
@@ -788,11 +788,482 @@
 size;%0A%09%7D
+%0A%0A%09public static void scaleTexCoord(Vector2 texCoord, TextureRegion tile, Vector2 out) %7B%0A%09%09out.x = scaleTexCoordU(texCoord.x, tile);%0A%09%09out.y = scaleTexCoordV(texCoord.y, tile);%0A%09%7D%0A%0A%09public static float scaleTexCoordU(float u, TextureRegion tile) %7B%0A%09%09return MathHelpers.scaleRange(u, 0.0f, 1.0f, tile.getU(), tile.getU2());%0A%09%7D%0A%0A%09public static float scaleTexCoordV(float v, TextureRegion tile) %7B%0A%09%09return MathHelpers.scaleRange(v, 0.0f, 1.0f, tile.getV(), tile.getV2());%0A%09%7D
 %0A%7D%0A

add texture coordinate scaling helper methods