Skip to content

Commit

Permalink
Fix setting default level background color (#4)
Browse files Browse the repository at this point in the history
Use `defaultLevelBgColor` instead of `bgColor`. `bgColor` is specifying
the background color for the level in the LDtk editor, which is not a
color which we want for the final game level.
  • Loading branch information
jobe-m authored Feb 6, 2024
1 parent 3cc31bd commit c590319
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class LDTKLevelView(
private val _layerViews = arrayListOf<View>()
private val _layerViewsByName = linkedHashMapOf<String, View>()

val bgLayer = solidRect(blevel.pxWid, blevel.pxHei, Colors[blevel.levelBgColor ?: ldtk.bgColor]).also {
val bgLayer = solidRect(blevel.pxWid, blevel.pxHei, Colors[blevel.levelBgColor ?: ldtk.defaultLevelBgColor]).also {
it.name = "background"
}
val layerViews = level.layers.asReversed().map { layer -> LDTKLayerView(layer, showCollisions).addTo(this) }
Expand Down

0 comments on commit c590319

Please sign in to comment.