Started work on an animation builder
This commit is contained in:
@@ -3,17 +3,21 @@ package fmon.draw
|
||||
import java.io.InputStream
|
||||
|
||||
import scalafx.geometry.Rectangle2D
|
||||
import scalafx.scene.image.{Image, ImageView}
|
||||
import scalafx.scene.image._
|
||||
|
||||
case class Box(val x: Int, val y: Int, val width: Int, val height: Int)
|
||||
|
||||
case class StillImg(val image: Image, val x: Double, val y: Double, val width: Double, val height: Double) extends Drawable {
|
||||
def draw(view: ImageView, t: Double): Unit = {
|
||||
def draw(view: ImageView, t: Double = 0): Unit = {
|
||||
if (view.image() != image.delegate) {
|
||||
view.image = image
|
||||
}
|
||||
view.viewport = new Rectangle2D(x, y, width, height)
|
||||
}
|
||||
|
||||
def croppedImage(): Image = {
|
||||
new WritableImage(image.pixelReader.get, x.toInt, y.toInt, width.toInt, height.toInt)
|
||||
}
|
||||
}
|
||||
|
||||
class Palette(val image: Image, val numAcross: Int, val numDown: Int) {
|
||||
|
||||
Reference in New Issue
Block a user