mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
uidriver/mobile: Refactoring: Give a default outside size
This commit is contained in:
parent
d0fce2a2db
commit
aef4b4ba53
@ -47,6 +47,11 @@ var (
|
||||
|
||||
theUI = &UserInterface{
|
||||
foreground: true,
|
||||
|
||||
// Give a default outside size so that the game can start without initializing them.
|
||||
outsideWidth: 640,
|
||||
outsideHeight: 480,
|
||||
sizeChanged: true,
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -58,6 +58,7 @@ func SetGame(game ebiten.Game) {
|
||||
panic("ebitenmobileview: SetGame cannot be called twice or more")
|
||||
}
|
||||
theState.game = game
|
||||
theState.errorCh = ebiten.RunGameWithoutMainLoop(theState.game)
|
||||
}
|
||||
|
||||
func Layout(viewWidth, viewHeight float64) {
|
||||
@ -65,9 +66,6 @@ func Layout(viewWidth, viewHeight float64) {
|
||||
defer theState.m.Unlock()
|
||||
|
||||
mobile.Get().SetOutsideSize(viewWidth, viewHeight)
|
||||
if !theState.isRunning() {
|
||||
theState.errorCh = ebiten.RunGameWithoutMainLoop(theState.game)
|
||||
}
|
||||
}
|
||||
|
||||
func Update() error {
|
||||
|
Loading…
Reference in New Issue
Block a user