working sign

This commit is contained in:
minjaesong
2024-03-20 22:32:09 +09:00
parent 4e739963d3
commit 708dccb015
4 changed files with 120 additions and 27 deletions

View File

@@ -1863,6 +1863,23 @@ open class ActorWithBody : Actor {
}
}
fun drawTextureInGoodPosition(frameDelta: Float, texture: TextureRegion, batch: SpriteBatch, forcedColourFilter: Color? = null) {
if (world == null) return
val offsetX = 0f
val offsetY = 0f
val posX = hitbox.startX.plus(PHYS_EPSILON_DIST).toFloat()
val posY = hitbox.startY.plus(PHYS_EPSILON_DIST).toFloat()
drawBodyInGoodPosition(posX, posY) { x, y ->
val oldCol = batch.color.cpy()
batch.color = if (forcedColourFilter != null) forcedColourFilter else Color.WHITE
batch.draw(texture, x + offsetX, y + offsetY)
batch.color = oldCol
}
}
override fun onActorValueChange(key: String, value: Any?) {
// do nothing
}