mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
parent
69300f0c4e
commit
39dc58658f
@ -46,6 +46,7 @@ var (
|
||||
flagFloating = flag.Bool("floating", false, "make the window floating")
|
||||
flagMaximize = flag.Bool("maximize", false, "maximize the window")
|
||||
flagVsync = flag.Bool("vsync", true, "enable vsync")
|
||||
flagAutoRestore = flag.Bool("autorestore", false, "restore the window automatically")
|
||||
flagInitFocused = flag.Bool("initfocused", true, "whether the window is focused on start")
|
||||
flagMinWindowSize = flag.String("minwindowsize", "", "minimum window size (e.g., 100x200)")
|
||||
flagMaxWindowSize = flag.String("maxwindowsize", "", "maximium window size (e.g., 1920x1080)")
|
||||
@ -246,7 +247,11 @@ func (g *game) Update() error {
|
||||
minimize := inpututil.IsKeyJustPressed(ebiten.KeyN)
|
||||
restore := false
|
||||
if ebiten.IsWindowMaximized() || ebiten.IsWindowMinimized() {
|
||||
restore = inpututil.IsKeyJustPressed(ebiten.KeyE)
|
||||
if *flagAutoRestore {
|
||||
restore = g.count%ebiten.MaxTPS() == 0
|
||||
} else {
|
||||
restore = inpututil.IsKeyJustPressed(ebiten.KeyE)
|
||||
}
|
||||
}
|
||||
|
||||
if toUpdateWindowSize {
|
||||
|
Loading…
Reference in New Issue
Block a user