mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
ui: Refactoring
This commit is contained in:
parent
1021521591
commit
bb5036b3e1
@ -174,19 +174,6 @@ func SetScreenScale(scale float64) bool {
|
|||||||
return r
|
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 {
|
func ScreenScale() float64 {
|
||||||
u := currentUI
|
u := currentUI
|
||||||
if !u.isRunning() {
|
if !u.isRunning() {
|
||||||
@ -213,6 +200,19 @@ func IsFullscreen() bool {
|
|||||||
return f
|
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) {
|
func ScreenOffset() (float64, float64) {
|
||||||
u := currentUI
|
u := currentUI
|
||||||
if !u.isRunning() {
|
if !u.isRunning() {
|
||||||
|
Loading…
Reference in New Issue
Block a user