ui: Refactoring

This commit is contained in:
Hajime Hoshi 2017-08-03 01:07:04 +09:00
parent 1021521591
commit bb5036b3e1

View File

@ -174,19 +174,6 @@ func SetScreenScale(scale float64) bool {
return r
}
func SetFullscreen(fullscreen bool) {
u := currentUI
if !u.isRunning() {
u.setInitFullscreen(fullscreen)
return
}
_ = u.runOnMainThread(func() error {
u := currentUI
u.setScreenSize(u.width, u.height, u.scale, fullscreen)
return nil
})
}
func ScreenScale() float64 {
u := currentUI
if !u.isRunning() {
@ -213,6 +200,19 @@ func IsFullscreen() bool {
return f
}
func SetFullscreen(fullscreen bool) {
u := currentUI
if !u.isRunning() {
u.setInitFullscreen(fullscreen)
return
}
_ = u.runOnMainThread(func() error {
u := currentUI
u.setScreenSize(u.width, u.height, u.scale, fullscreen)
return nil
})
}
func ScreenOffset() (float64, float64) {
u := currentUI
if !u.isRunning() {