mirror of
https://github.com/yairm210/Unciv.git
synced 2025-03-09 20:29:50 +07:00
moving city button with absolute coordinates to prevent it from wandering around (#794)
This commit is contained in:
parent
eb3ba51396
commit
b49270e690
@ -105,7 +105,7 @@ class CityButton(val city: CityInfo, internal val tileGroup: WorldTileGroup, ski
|
||||
|
||||
private fun moveButtonDown() {
|
||||
val moveButtonAction = Actions.sequence(
|
||||
Actions.moveBy(0f, -height, 0.4f, Interpolation.swingOut),
|
||||
Actions.moveTo(tileGroup.x, tileGroup.y-height, 0.4f, Interpolation.swingOut),
|
||||
Actions.run { isButtonMoved=true }
|
||||
)
|
||||
parent.addAction(moveButtonAction) // Move the whole cityButtonLayerGroup down, so the citybutton remains clickable
|
||||
@ -113,7 +113,7 @@ class CityButton(val city: CityInfo, internal val tileGroup: WorldTileGroup, ski
|
||||
|
||||
private fun moveButtonUp() {
|
||||
val floatAction = Actions.sequence(
|
||||
Actions.moveBy(0f, height, 0.4f, Interpolation.sine),
|
||||
Actions.moveTo(tileGroup.x, tileGroup.y, 0.4f, Interpolation.sine),
|
||||
Actions.run {isButtonMoved=false}
|
||||
)
|
||||
parent.addAction(floatAction)
|
||||
|
Loading…
Reference in New Issue
Block a user