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