mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-12 19:44:05 +09:00
another way to scroll
This commit is contained in:
@@ -96,7 +96,12 @@ class UIBuildingMakerBlockChooser(val parent: BuildingMaker): UICanvas() {
|
|||||||
|
|
||||||
addUIitem(it)
|
addUIitem(it)
|
||||||
it.selectionChangeListener = { value ->
|
it.selectionChangeListener = { value ->
|
||||||
|
val oldScroll = scroll
|
||||||
scroll = value.roundToInt()
|
scroll = value.roundToInt()
|
||||||
|
|
||||||
|
palette.forEach {
|
||||||
|
it.posY -= (scroll - oldScroll) * TILESREGION_SIZE
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -146,7 +151,7 @@ class UIBuildingMakerBlockChooser(val parent: BuildingMaker): UICanvas() {
|
|||||||
closeButton.render(batch, camera)
|
closeButton.render(batch, camera)
|
||||||
|
|
||||||
palette.visible.forEach {
|
palette.visible.forEach {
|
||||||
it.render(batch, camera, 0, -scroll * TILESREGION_SIZE)
|
it.render(batch, camera)
|
||||||
}
|
}
|
||||||
|
|
||||||
uiItems.forEach { it.render(batch, camera) }
|
uiItems.forEach { it.render(batch, camera) }
|
||||||
|
|||||||
Reference in New Issue
Block a user