diff --git a/core/src/commonMain/kotlin/com/lehaine/littlekt/graphics/g2d/SpriteBatch.kt b/core/src/commonMain/kotlin/com/lehaine/littlekt/graphics/g2d/SpriteBatch.kt index a839ac977..1cf191fa3 100644 --- a/core/src/commonMain/kotlin/com/lehaine/littlekt/graphics/g2d/SpriteBatch.kt +++ b/core/src/commonMain/kotlin/com/lehaine/littlekt/graphics/g2d/SpriteBatch.kt @@ -73,11 +73,11 @@ class SpriteBatch( override var projectionMatrix = Mat4().setToOrthographic( left = 0f, right = context.graphics.width.toFloat(), - bottom = 0f, - top = context.graphics.height.toFloat(), + bottom = context.graphics.height.toFloat(), + top = 0f, near = -1f, far = 1f - ) + ).translate(0f, -context.graphics.height * 0.5f, 0f) set(value) { if (_drawing) { flush() diff --git a/core/src/commonMain/kotlin/com/lehaine/littlekt/graphics/g2d/TextureArraySpriteBatch.kt b/core/src/commonMain/kotlin/com/lehaine/littlekt/graphics/g2d/TextureArraySpriteBatch.kt index b8954a649..d680b48bf 100644 --- a/core/src/commonMain/kotlin/com/lehaine/littlekt/graphics/g2d/TextureArraySpriteBatch.kt +++ b/core/src/commonMain/kotlin/com/lehaine/littlekt/graphics/g2d/TextureArraySpriteBatch.kt @@ -94,11 +94,11 @@ class TextureArraySpriteBatch( override var projectionMatrix = Mat4().setToOrthographic( left = 0f, right = context.graphics.width.toFloat(), - bottom = 0f, - top = context.graphics.height.toFloat(), + bottom = context.graphics.height.toFloat(), + top = 0f, near = -1f, far = 1f - ) + ).translate(0f, -context.graphics.height * 0.5f, 0f) set(value) { if (_drawing) { flush()