F12 for screenshot; it's high time to care about TVs

(besides, the EBU gap is also a good guideline for placing UIs on edge)
This commit is contained in:
minjaesong
2019-01-23 03:46:46 +09:00
parent 78cf9298e1
commit 200ff94ff8
6 changed files with 58 additions and 11 deletions

View File

@@ -68,6 +68,8 @@ class IngameController(val ingame: Ingame) : InputAdapter() {
/////////////////////
}
private var f12Down = false
override fun keyDown(keycode: Int): Boolean {
if (ingame.canPlayerControl) {
@@ -98,6 +100,15 @@ class IngameController(val ingame: Ingame) : InputAdapter() {
}
// screenshot key
if (keycode == Input.Keys.F12 && !f12Down) {
AppLoader.requestScreenshot()
// FIXME
//ingame.sendNotification(arrayOf("Screenshot taken", ""))
f12Down = true
println("Screenshot taken.")
}
return true
}
@@ -111,6 +122,10 @@ class IngameController(val ingame: Ingame) : InputAdapter() {
ingame.uiContainer.forEach { it.keyUp(keycode) } // for KeyboardControlled UIcanvases
// screenshot key
if (keycode == Input.Keys.F12) f12Down = false
return true
}

View File

@@ -3,7 +3,7 @@ package net.torvald.terrarum.gamecontroller
/**
* Created by minjaesong on 2016-01-15.
*/
@Deprecated("Use Gdx.Input.Keys")
/*@Deprecated("Use Gdx.Input.Keys")
object DeprecatedAsFuckKey {
val RETURN = 28
@@ -90,4 +90,4 @@ object DeprecatedAsFuckKey {
val PGDN = 209
val HOME = 199
val END = 207
}
}*/