mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 03:38:55 +01:00
mobile/ebitenmobileview: Use uidriver.mobile's functions
This is a preparation to deprecate SetScreenSize and SetScreenScale.
This commit is contained in:
parent
a449045ae2
commit
8f08565488
@ -25,6 +25,7 @@ import (
|
|||||||
"runtime"
|
"runtime"
|
||||||
|
|
||||||
"github.com/hajimehoshi/ebiten"
|
"github.com/hajimehoshi/ebiten"
|
||||||
|
"github.com/hajimehoshi/ebiten/internal/uidriver/mobile"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ViewRectSetter interface {
|
type ViewRectSetter interface {
|
||||||
@ -59,8 +60,8 @@ func layout(viewWidth, viewHeight int, viewRectSetter ViewRectSetter) {
|
|||||||
y := (viewHeight - height) / 2
|
y := (viewHeight - height) / 2
|
||||||
|
|
||||||
if theState.isRunning() {
|
if theState.isRunning() {
|
||||||
ebiten.SetScreenSize(w, h)
|
mobile.Get().SetScreenSize(w, h)
|
||||||
ebiten.SetScreenScale(scale)
|
mobile.Get().SetScreenScale(scale)
|
||||||
} else {
|
} else {
|
||||||
// The last argument 'title' is not used on mobile platforms, so just pass an empty string.
|
// The last argument 'title' is not used on mobile platforms, so just pass an empty string.
|
||||||
theState.errorCh = ebiten.RunWithoutMainLoop(theState.game.Update, w, h, scale, "")
|
theState.errorCh = ebiten.RunWithoutMainLoop(theState.game.Update, w, h, scale, "")
|
||||||
|
Loading…
Reference in New Issue
Block a user