mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-11 02:54:04 +09:00
new param 'frameDelta' on every render() function
This commit is contained in:
@@ -165,7 +165,7 @@ class AssembledSpriteAnimation(
|
||||
} ?: throw NullPointerException("Animation with name '$animNameRoot' is not found")
|
||||
}
|
||||
|
||||
override fun render(batch: SpriteBatch, posX: Float, posY: Float, scale: Float) {
|
||||
override fun render(frameDelta: Float, batch: SpriteBatch, posX: Float, posY: Float, scale: Float) {
|
||||
if (parentActor.isVisible) {
|
||||
batch.color = colourFilter
|
||||
renderThisAnimation(batch, posX, posY, scale, "${currentAnimation}_${1+currentFrame}")
|
||||
|
||||
@@ -16,7 +16,7 @@ import net.torvald.terrarumsansbitmap.gdx.TextureRegionPack
|
||||
abstract class SpriteAnimation(@Transient val parentActor: ActorWithBody) : Disposable {
|
||||
protected abstract val currentDelay: Second
|
||||
abstract fun update(delta: Float)
|
||||
abstract fun render(batch: SpriteBatch, posX: Float, posY: Float, scale: Float = 1f)
|
||||
abstract fun render(frameDelta: Float, batch: SpriteBatch, posX: Float, posY: Float, scale: Float = 1f)
|
||||
|
||||
var flipHorizontal = false
|
||||
var flipVertical = false
|
||||
@@ -143,7 +143,7 @@ class SheetSpriteAnimation(parentActor: ActorWithBody) : SpriteAnimation(parentA
|
||||
* *
|
||||
* @param scale
|
||||
*/
|
||||
override fun render(batch: SpriteBatch, posX: Float, posY: Float, scale: Float) {
|
||||
override fun render(frameDelta: Float, batch: SpriteBatch, posX: Float, posY: Float, scale: Float) {
|
||||
assert(cellWidth > 0 || cellHeight > 0) {
|
||||
"Sprite width or height is set to zero! ($cellWidth, $cellHeight); master: $parentActor"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user