uidriver/mobile: Add comments

This commit is contained in:
Hajime Hoshi 2020-02-11 13:43:58 +09:00
parent 024fc48647
commit a303487328
2 changed files with 3 additions and 0 deletions

View File

@ -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()

View File

@ -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)