mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-26 21:35:14 -04:00
Better minimap buttons
This commit is contained in:
parent
1731e8aa44
commit
f613bba7d4
@ -25,13 +25,14 @@ class MapOverlayToggleButton(
|
|||||||
/** [Actor] of the button. Add this to whatever layout. */
|
/** [Actor] of the button. Add this to whatever layout. */
|
||||||
val actor: IconCircleGroup by lazy {
|
val actor: IconCircleGroup by lazy {
|
||||||
var innerActor: Actor = icon
|
var innerActor: Actor = icon
|
||||||
|
val iconSize = 30f
|
||||||
if (backgroundColor != null) {
|
if (backgroundColor != null) {
|
||||||
innerActor = innerActor
|
innerActor = innerActor
|
||||||
.surroundWithCircle(30f)
|
.surroundWithCircle(iconSize)
|
||||||
.apply { circle.color = backgroundColor }
|
.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.
|
// 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 {
|
init {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user