mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-16 16:46:07 +09:00
colorutil update, some code cleanup
Former-commit-id: 47b13e7e899dc9151f7a1ae71977ed8d4b403345 Former-commit-id: 136f9c787b76aec75d76535891cf264170bd3b04
This commit is contained in:
@@ -20,10 +20,10 @@ class SpriteAnimation(val parentActor: ActorWithBody) {
|
||||
private set
|
||||
var width: Int = 0
|
||||
private set
|
||||
private var currentFrame = 1
|
||||
private var currentRow = 1
|
||||
private var nFrames: Int = 0
|
||||
private var nRows: Int = 0
|
||||
private var currentFrame = 1 // one-based!
|
||||
private var currentRow = 1 // one-based!
|
||||
private var nFrames: Int = 1
|
||||
private var nRows: Int = 1
|
||||
private var delay = 200
|
||||
private var delta = 0
|
||||
private val looping = true
|
||||
@@ -46,11 +46,14 @@ class SpriteAnimation(val parentActor: ActorWithBody) {
|
||||
* *
|
||||
* @throws SlickException
|
||||
*/
|
||||
@Throws(SlickException::class)
|
||||
fun setSpriteImage(imagePath: String) {
|
||||
spriteImage = SpriteSheet(imagePath, this.width, this.height)
|
||||
}
|
||||
|
||||
fun setSpriteImage(image: Image) {
|
||||
spriteImage = SpriteSheet(image, this.width, this.height)
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets animation delay. Will default to 200 if not called.
|
||||
* @param delay in milliseconds
|
||||
@@ -60,10 +63,9 @@ class SpriteAnimation(val parentActor: ActorWithBody) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets sprite dimension. This is necessary.
|
||||
* @param w
|
||||
* *
|
||||
* @param h
|
||||
* Sets sprite dimension. This is necessary for this to work.
|
||||
* @param w width of the animation frame
|
||||
* @param h height of the animation frame
|
||||
*/
|
||||
fun setDimension(w: Int, h: Int) {
|
||||
width = w
|
||||
|
||||
Reference in New Issue
Block a user