Better minimap buttons

This commit is contained in:
Yair Morgenstern
2022-05-29 00:07:07 +03:00
parent 1731e8aa44
commit f613bba7d4

View File

@ -25,13 +25,14 @@ class MapOverlayToggleButton(
/** [Actor] of the button. Add this to whatever layout. */
val actor: IconCircleGroup by lazy {
var innerActor: Actor = icon
val iconSize = 30f
if (backgroundColor != null) {
innerActor = innerActor
.surroundWithCircle(30f)
.surroundWithCircle(iconSize)
.apply { circle.color = backgroundColor }
}
} else innerActor.setSize(iconSize,iconSize)
// So, the "Food" and "Population" stat icons have green as part of their image, but the "Cattle" icon needs a background colour, which is… An interesting mixture/reuse of texture data and render-time processing.
innerActor.surroundWithCircle(40f).apply { circle.color = Color.BLACK }
innerActor.surroundWithCircle(32f, resizeActor = false).apply { circle.color = Color.BLACK }
}
init {