Can now save and load animations
This commit is contained in:
@@ -47,4 +47,20 @@ class Palette(val image: Image, val numAcross: Int, val numDown: Int) {
|
||||
this(x, y)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
object Palette {
|
||||
def square(stream: InputStream, numAcross: Int) = {
|
||||
val img = new Image(stream)
|
||||
val size = img.width() / numAcross
|
||||
val numDown = img.height() / size
|
||||
new Palette(img, numAcross, numDown.toInt)
|
||||
}
|
||||
|
||||
def bySize(stream: InputStream, width: Double, height: Double) = {
|
||||
val img = new Image(stream)
|
||||
val numAcross = img.width() / width
|
||||
val numDown = img.height() / height
|
||||
new Palette(img, numAcross.toInt, numDown.toInt)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user