Keyboard strobing moved to a new thread so that fast typing is possible even if the game's update method is running slowly

This commit is contained in:
minjaesong
2021-11-06 11:30:42 +09:00
parent ddd7492922
commit 7503876d1f
15 changed files with 240 additions and 131 deletions

View File

@@ -6,6 +6,7 @@ import com.badlogic.gdx.utils.Disposable
import net.torvald.terrarum.App
import net.torvald.terrarum.Second
import net.torvald.terrarum.Terrarum
import net.torvald.terrarum.gamecontroller.TerrarumKeyboardEvent
import kotlin.math.roundToInt
@@ -219,6 +220,12 @@ abstract class UICanvas(
return false
}
open fun inputStrobed(e: TerrarumKeyboardEvent) {
if (this.isVisible) {
uiItems.forEach { it.inputStrobed(e) }
handler.subUIs.forEach { it.inputStrobed(e) }
}
}
open fun resize(width: Int, height: Int) {
this.width = width