From b952cb724f5aaedef4bc2c704edc3bd2b5cffe54 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sat, 7 Apr 2018 22:23:50 +0900 Subject: [PATCH] examples/flappy: Fullscreen on browsers --- examples/flappy/main.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/flappy/main.go b/examples/flappy/main.go index ddf464a73..63089ec9d 100644 --- a/examples/flappy/main.go +++ b/examples/flappy/main.go @@ -25,6 +25,7 @@ import ( "log" "math" "math/rand" + "runtime" "time" "github.com/golang/freetype/truetype" @@ -379,6 +380,11 @@ func (g *Game) drawGopher(screen *ebiten.Image) { func main() { g := NewGame() + // On browsers, let's use fullscreen so that this is playable on any browsers. + // It is planned to ignore the given 'scale' apply fullscreen automatically on browsers (#571). + if runtime.GOARCH == "js" { + ebiten.SetFullscreen(true) + } if err := ebiten.Run(g.Update, screenWidth, screenHeight, 1, "Flappy Gopher (Ebiten Demo)"); err != nil { panic(err) }