mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-22 16:34:05 +09:00
vital metre prototype
Former-commit-id: c3f95f7ef280eabc5516ad6885386cb89d6ee35d Former-commit-id: ab9cd5bd8daf27d37828a5ca4a737a723d76fa1a
This commit is contained in:
@@ -49,6 +49,28 @@ interface UICanvas {
|
||||
* Do not modify handler!!.openCloseCounter here.
|
||||
*/
|
||||
fun endClosing(gc: GameContainer, delta: Int)
|
||||
}
|
||||
|
||||
const val OPENCLOSE_GENERIC = 200
|
||||
companion object {
|
||||
const val OPENCLOSE_GENERIC = 200
|
||||
|
||||
fun doOpeningFade(handler: UIHandler?, openCloseTime: Int) {
|
||||
handler!!.opacity = handler!!.openCloseCounter.toFloat() / openCloseTime
|
||||
}
|
||||
|
||||
fun doClosingFade(handler: UIHandler?, openCloseTime: Int) {
|
||||
handler!!.opacity = (openCloseTime - handler!!.openCloseCounter.toFloat()) / openCloseTime
|
||||
}
|
||||
|
||||
fun endOpeningFade(handler: UIHandler?) {
|
||||
handler!!.opacity = 1f
|
||||
}
|
||||
|
||||
fun endClosingFade(handler: UIHandler?) {
|
||||
handler!!.opacity = 0f
|
||||
}
|
||||
|
||||
// TODO add drawer slide in/out (quadratic)
|
||||
|
||||
// TODO add blackboard take in/out (sinusoidal)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user