mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-27 11:12:44 +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{
|
theUI = &UserInterface{
|
||||||
foreground: true,
|
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")
|
panic("ebitenmobileview: SetGame cannot be called twice or more")
|
||||||
}
|
}
|
||||||
theState.game = game
|
theState.game = game
|
||||||
|
theState.errorCh = ebiten.RunGameWithoutMainLoop(theState.game)
|
||||||
}
|
}
|
||||||
|
|
||||||
func Layout(viewWidth, viewHeight float64) {
|
func Layout(viewWidth, viewHeight float64) {
|
||||||
@ -65,9 +66,6 @@ func Layout(viewWidth, viewHeight float64) {
|
|||||||
defer theState.m.Unlock()
|
defer theState.m.Unlock()
|
||||||
|
|
||||||
mobile.Get().SetOutsideSize(viewWidth, viewHeight)
|
mobile.Get().SetOutsideSize(viewWidth, viewHeight)
|
||||||
if !theState.isRunning() {
|
|
||||||
theState.errorCh = ebiten.RunGameWithoutMainLoop(theState.game)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func Update() error {
|
func Update() error {
|
||||||
|
Loading…
Reference in New Issue
Block a user