import com.badlogic.gdx.graphics.GL11;\r
import com.badlogic.gdx.graphics.OrthographicCamera;\r
import com.badlogic.gdx.graphics.g2d.SpriteCache;\r
-import com.badlogic.gdx.graphics.g2d.TextureAtlas.AtlasRegion;\r
import com.badlogic.gdx.graphics.g2d.TextureRegion;\r
import com.badlogic.gdx.graphics.glutils.ShaderProgram;\r
import com.badlogic.gdx.math.MathUtils;\r
-import com.badlogic.gdx.math.Matrix3;\r
import com.badlogic.gdx.math.Matrix4;\r
import com.badlogic.gdx.math.Vector3;\r
import com.badlogic.gdx.utils.Disposable;\r
int lastCol = firstCol + tilesPerBlockX;\r
int lastRow = firstRow + tilesPerBlockY;\r
\r
+ float offsetX = ((tileWidth - unitsPerTileX) / 2);\r
+ float offsetY = ((tileHeight - unitsPerTileY) / 2);\r
+ \r
for (int row = firstRow; row < lastRow && row < layer.length; row++) {\r
for (int col = firstCol; col < lastCol && col < layer[row].length; col++) {\r
int tile = layer[row][col];\r
TextureRegion reg = atlas.getRegion(tile);\r
if (reg != null) {\r
\r
- float x = col * unitsPerTileX;\r
- float y = (layer.length - row - 1) * unitsPerTileY;\r
+ float x = col * unitsPerTileX - offsetX;\r
+ float y = (layer.length - row - 1) * unitsPerTileY - offsetY;\r
float width = reg.getRegionWidth();\r
float height = reg.getRegionHeight(); \r
float originX = width * 0.5f;\r