Skip to content

Commit

Permalink
feat(ui): new graphics
Browse files Browse the repository at this point in the history
  • Loading branch information
xeruf committed Jun 25, 2021
1 parent 1253584 commit e8efd2b
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/main/kotlin/sc/gui/view/BoardView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ class PieceImage(private val sizeProperty: ObservableDoubleValue, private val co
}

fun addChild(graphic: String) {
val moewe = graphic == "moewe"
children.add(0, ResizableImageView(
sizeProperty,
ResourceLookup(this)["/graphics/$graphic.png"],
if (moewe) 1.5 else 1.0,
).also {
if (moewe)
it.scaleX = -1.0
})
when(graphic) {
"moewe" -> 1.2
"robbe" -> 1.4
else -> 1.0
}
))
}

override fun toString(): String = "PieceImage@${Integer.toHexString(hashCode())}(content = $content)"
Expand Down
Binary file modified src/main/resources/graphics/amber.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/main/resources/graphics/herzmuschel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/main/resources/graphics/moewe.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/main/resources/graphics/robbe.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e8efd2b

Please sign in to comment.