diff --git a/exp/textinput/textinput_js.go b/exp/textinput/textinput_js.go index 436eaae00..dba3e5c86 100644 --- a/exp/textinput/textinput_js.go +++ b/exp/textinput/textinput_js.go @@ -78,14 +78,14 @@ func (t *textInput) init() { e.Call("preventDefault") } if !e.Get("isComposing").Bool() { - ui.UpdateInputFromEvent(e) + ui.Get().UpdateInputFromEvent(e) } return nil })) t.textareaElement.Call("addEventListener", "keyup", js.FuncOf(func(this js.Value, args []js.Value) any { e := args[0] if !e.Get("isComposing").Bool() { - ui.UpdateInputFromEvent(e) + ui.Get().UpdateInputFromEvent(e) } return nil })) diff --git a/internal/ui/input_js.go b/internal/ui/input_js.go index e76d5594c..d1514d8f0 100644 --- a/internal/ui/input_js.go +++ b/internal/ui/input_js.go @@ -223,8 +223,8 @@ func (u *UserInterface) KeyName(key Key) string { return n.String() } -func UpdateInputFromEvent(e js.Value) { - theUI.updateInputFromEvent(e) +func (u *UserInterface) UpdateInputFromEvent(e js.Value) { + u.updateInputFromEvent(e) } func (u *UserInterface) saveCursorPosition() { diff --git a/internal/ui/ui_ios.go b/internal/ui/ui_ios.go index 74e014e96..2249c370d 100644 --- a/internal/ui/ui_ios.go +++ b/internal/ui/ui_ios.go @@ -65,12 +65,12 @@ func (g *graphicsDriverCreatorImpl) newMetal() (graphicsdriver.Graphics, error) return metal.NewGraphics() } -func SetUIView(uiview uintptr) error { - return theUI.setUIView(uiview) +func (u *UserInterface) SetUIView(uiview uintptr) error { + return u.setUIView(uiview) } -func IsGL() (bool, error) { - return theUI.isGL() +func (u *UserInterface) IsGL() (bool, error) { + return u.isGL() } func (u *UserInterface) setUIView(uiview uintptr) error { diff --git a/mobile/ebitenmobileview/view_ios.go b/mobile/ebitenmobileview/view_ios.go index 835f7ada3..4d5efb773 100644 --- a/mobile/ebitenmobileview/view_ios.go +++ b/mobile/ebitenmobileview/view_ios.go @@ -19,9 +19,9 @@ import ( ) func SetUIView(uiview int64) error { - return ui.SetUIView(uintptr(uiview)) + return ui.Get().SetUIView(uintptr(uiview)) } func IsGL() (bool, error) { - return ui.IsGL() + return ui.Get().IsGL() }