mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-10 10:34:06 +09:00
fix: player was drawn 1px lower than they should be
This commit is contained in:
Binary file not shown.
@@ -180,7 +180,7 @@ class AssembledSpriteAnimation(
|
|||||||
val w = image.regionWidth * scale
|
val w = image.regionWidth * scale
|
||||||
val h = image.regionHeight * scale
|
val h = image.regionHeight * scale
|
||||||
val fposX = posX.floorToFloat() + drawPos.x * scale
|
val fposX = posX.floorToFloat() + drawPos.x * scale
|
||||||
val fposY = posY.floorToFloat() + drawPos.y * scale - h
|
val fposY = (posY - 0.5f).floorToFloat() + drawPos.y * scale - h
|
||||||
|
|
||||||
// draw
|
// draw
|
||||||
if (flipHorizontal && flipVertical)
|
if (flipHorizontal && flipVertical)
|
||||||
@@ -205,7 +205,7 @@ class AssembledSpriteAnimation(
|
|||||||
val w = image.regionWidth * scale
|
val w = image.regionWidth * scale
|
||||||
val h = image.regionHeight * scale
|
val h = image.regionHeight * scale
|
||||||
val fposX = posX.floorToFloat() + drawPos.x * scale
|
val fposX = posX.floorToFloat() + drawPos.x * scale
|
||||||
val fposY = posY.floorToFloat() + drawPos.y * scale
|
val fposY = (posY - 0.5f).floorToFloat() + drawPos.y * scale
|
||||||
|
|
||||||
if (flipHorizontal && flipVertical)
|
if (flipHorizontal && flipVertical)
|
||||||
batch.draw(image, fposX + txFlp, fposY + tyFlp, -w, -h)
|
batch.draw(image, fposX + txFlp, fposY + tyFlp, -w, -h)
|
||||||
|
|||||||
Reference in New Issue
Block a user