From a3034873288d38c12660a14391c26376ec536b97 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Tue, 11 Feb 2020 13:43:58 +0900 Subject: [PATCH] uidriver/mobile: Add comments --- internal/uidriver/mobile/ui.go | 2 ++ mobile/ebitenmobileview/funcs.go | 1 + 2 files changed, 3 insertions(+) diff --git a/internal/uidriver/mobile/ui.go b/internal/uidriver/mobile/ui.go index d1fb06c94..6a6c81c93 100644 --- a/internal/uidriver/mobile/ui.go +++ b/internal/uidriver/mobile/ui.go @@ -58,6 +58,7 @@ func Get() *UserInterface { return theUI } +// Update is called from mobile/ebitenmobileview. func (u *UserInterface) Update() { u.m.Lock() fg := u.foreground @@ -332,6 +333,7 @@ func (u *UserInterface) ScreenSizeInFullscreen() (int, int) { return 0, 0 } +// SetScreenSizeAndScale is called from mobile/ebitenmobileview. func (u *UserInterface) SetScreenSizeAndScale(width, height int, scale float64) { // Called from ebitenmobileview. u.m.Lock() diff --git a/mobile/ebitenmobileview/funcs.go b/mobile/ebitenmobileview/funcs.go index d1d9efb19..27fd402ab 100644 --- a/mobile/ebitenmobileview/funcs.go +++ b/mobile/ebitenmobileview/funcs.go @@ -47,6 +47,7 @@ func layout(viewWidth, viewHeight int, viewRectSetter ViewRectSetter) { return } + // TODO: Layout must be called every frame like uiContext already did. w, h := theState.game.Layout(int(viewWidth), int(viewHeight)) scaleX := float64(viewWidth) / float64(w) scaleY := float64(viewHeight) / float64(h)