implementation of Pie Menu

Former-commit-id: 0ff65782d25f0bf73435d297cf70d93e80882090
Former-commit-id: c31e1675890bb098addd2467f1137cb20038ec7d
This commit is contained in:
Song Minjae
2016-07-20 21:40:26 +09:00
parent 222bf0811c
commit 00dd5e99bb
30 changed files with 513 additions and 192 deletions

View File

@@ -15,7 +15,7 @@ constructor() : UICanvas {
override var width: Int = 0
override var height: Int = 0
internal var visibleTime: Int
internal var showupTimeConuter = 0
override var openCloseTimer = 0
internal var isShowing = false
internal var message: Array<String> = Array(MessageWindow.MESSAGES_DISPLAY, { i -> ""})
@@ -24,6 +24,8 @@ constructor() : UICanvas {
override var openCloseTime: Int = MessageWindow.OPEN_CLOSE_TIME
override var handler: UIHandler? = null
private val SHOWUP_MAX = 15000
init {
@@ -37,7 +39,7 @@ constructor() : UICanvas {
}
override fun update(gc: GameContainer, delta: Int) {
if (showupTimeConuter >= visibleTime && isShowing) {
if (openCloseTimer >= visibleTime && isShowing) {
// invoke closing mode
doClosing(gc, delta)
// check if msgUI is fully fade out
@@ -48,7 +50,7 @@ constructor() : UICanvas {
}
if (isShowing) {
showupTimeConuter += delta
openCloseTimer += delta
}
}
@@ -82,6 +84,6 @@ constructor() : UICanvas {
isShowing = true
this.message = message
msgUI.setMessage(this.message)
showupTimeConuter = 0
openCloseTimer = 0
}
}