X-Git-Url: https://deadsoftware.ru/gitweb?a=blobdiff_plain;f=core%2Fsrc%2Fru%2Fdeadsoftware%2Fcavedroid%2Fmisc%2Futils%2FSpriteUtils.kt;h=7d7aae110b22aa7a02b2c571fd1481906012cfd3;hb=076b501cc25dc05c9fd26e3f71d850c7277120cb;hp=72165e7cb196e4bf03dcb39fe8c7efb548aef05f;hpb=2b0cd1ba5dbf194bd5ed35964c0cb2ea16293be4;p=cavedroid.git diff --git a/core/src/ru/deadsoftware/cavedroid/misc/utils/SpriteUtils.kt b/core/src/ru/deadsoftware/cavedroid/misc/utils/SpriteUtils.kt index 72165e7..7d7aae1 100644 --- a/core/src/ru/deadsoftware/cavedroid/misc/utils/SpriteUtils.kt +++ b/core/src/ru/deadsoftware/cavedroid/misc/utils/SpriteUtils.kt @@ -7,12 +7,12 @@ import com.badlogic.gdx.graphics.g2d.SpriteBatch * Draw sprite at given position rotated by [rotation] degrees */ @JvmOverloads -fun SpriteBatch.draw(sprite: Sprite, x: Float, y: Float, rotation: Float = 0f) { +fun SpriteBatch.drawSprite(sprite: Sprite, x: Float, y: Float, rotation: Float = 0f) { sprite.rotation = rotation sprite.setPosition(x, y) sprite.draw(this) } fun Sprite.applyOrigin(origin: SpriteOrigin) { - setOrigin(width * origin.x, height * origin.y) + origin.applyToSprite(this) } \ No newline at end of file