btex: finally working <a> tag

This commit is contained in:
minjaesong
2024-05-18 18:15:27 +09:00
parent 1cb70c4620
commit 9e9ab5bfe0
4 changed files with 58 additions and 18 deletions

View File

@@ -3,6 +3,8 @@ package net.torvald.terrarum.tests
import com.badlogic.gdx.ApplicationAdapter
import com.badlogic.gdx.Gdx
import com.badlogic.gdx.Input
import com.badlogic.gdx.InputAdapter
import com.badlogic.gdx.InputProcessor
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3ApplicationConfiguration
import com.badlogic.gdx.graphics.Color
@@ -106,6 +108,21 @@ class BTeXTest : ApplicationAdapter() {
println("Time spent on loading [ms]: $it")
}
}
Gdx.input.inputProcessor = object : InputAdapter() {
override fun touchDown(screenX: Int, screenY: Int, pointer: Int, button: Int): Boolean {
if (::viewer.isInitialized)
viewer.touchDown(screenX, screenY, pointer, button)
return true
}
override fun touchUp(screenX: Int, screenY: Int, pointer: Int, button: Int): Boolean {
if (::viewer.isInitialized)
viewer.touchUp(screenX, screenY, pointer, button)
return true
}
}
}
var init = false