actor draw planting offset

This commit is contained in:
minjaesong
2023-08-08 17:14:13 +09:00
parent 2411db17a7
commit 88d844cc09
3 changed files with 17 additions and 6 deletions

View File

@@ -1764,9 +1764,12 @@ open class ActorWithBody : Actor {
if (world == null) return
val offsetX = 0f
val offsetY = 1f // plant to the ground
val offsetY = 0f // for some reason this value must be zero to draw the actor planted to the ground
drawBodyInGoodPosition(hitbox.startX.toFloat(), hitbox.startY.toFloat()) { x, y ->
val posX = hitbox.startX.plus(PHYS_EPSILON_DIST).toFloat()
val posY = hitbox.startY.plus(PHYS_EPSILON_DIST).toFloat()
drawBodyInGoodPosition(posX, posY) { x, y ->
sprite.render(batch, x + offsetX, y + offsetY, scale.toFloat())
}
}