titlescreen: camera follows terraini undulation

This commit is contained in:
minjaesong
2017-07-22 18:27:58 +09:00
parent 116b4cc390
commit d753365e54
9 changed files with 305 additions and 144 deletions

View File

@@ -0,0 +1,68 @@
package net.torvald.terrarum.ui
import com.badlogic.gdx.graphics.Color
import com.badlogic.gdx.graphics.g2d.SpriteBatch
import net.torvald.terrarum.gameactors.Second
class UITitleRemoConCredits(val superMenu: UICanvas) : UICanvas() {
val menuLabels = arrayOf(
"MENU_LABEL_CREDITS",
"MENU_CREDIT_GPL_DNT",
"MENU_LABEL_RETURN"
)
override var width: Int = UITitleRemoConRoot.remoConWidth
override var height: Int = UITitleRemoConRoot.getRemoConHeight(menuLabels)
override var openCloseTime: Second = 0f
private val menubar = UIItemTextButtonList(
this,
menuLabels,
this.width, this.height,
textAreaWidth = this.width,
readFromLang = true,
activeBackCol = Color(0),
highlightBackCol = Color(0),
backgroundCol = Color(0),
inactiveCol = Color.WHITE,
defaultSelection = null
)
init {
uiItems.add(menubar)
// attach listeners
menubar.buttons[menuLabels.indexOf("MENU_LABEL_RETURN")].clickOnceListener = { _, _, _ ->
superMenu.handler.setAsOpen()
this.handler.setAsClose()
}
}
override fun update(delta: Float) {
menubar.update(delta)
}
override fun render(batch: SpriteBatch) {
menubar.render(batch)
}
override fun doOpening(delta: Float) {
}
override fun doClosing(delta: Float) {
}
override fun endOpening(delta: Float) {
}
override fun endClosing(delta: Float) {
}
override fun dispose() {
}
}