mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
ebiten: Change the default value of IsRunningOnUnfocused to be true
Fixes #1180
This commit is contained in:
parent
d0ee71a069
commit
41cf90a321
@ -151,7 +151,6 @@ func (m *mascot) Draw(screen *ebiten.Image) {
|
|||||||
func main() {
|
func main() {
|
||||||
ebiten.SetScreenTransparent(true)
|
ebiten.SetScreenTransparent(true)
|
||||||
ebiten.SetWindowDecorated(false)
|
ebiten.SetWindowDecorated(false)
|
||||||
ebiten.SetRunnableOnUnfocused(true)
|
|
||||||
ebiten.SetWindowFloating(true)
|
ebiten.SetWindowFloating(true)
|
||||||
ebiten.SetWindowSize(width, height)
|
ebiten.SetWindowSize(width, height)
|
||||||
if err := ebiten.RunGame(&mascot{}); err != nil {
|
if err := ebiten.RunGame(&mascot{}); err != nil {
|
||||||
|
@ -92,6 +92,7 @@ const (
|
|||||||
|
|
||||||
var (
|
var (
|
||||||
theUI = &UserInterface{
|
theUI = &UserInterface{
|
||||||
|
runnableOnUnfocused: true,
|
||||||
origPosX: invalidPos,
|
origPosX: invalidPos,
|
||||||
origPosY: invalidPos,
|
origPosY: invalidPos,
|
||||||
initVsync: true,
|
initVsync: true,
|
||||||
|
@ -46,9 +46,10 @@ type UserInterface struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var theUI = &UserInterface{
|
var theUI = &UserInterface{
|
||||||
sizeChanged: true,
|
runnableOnUnfocused: true,
|
||||||
vsync: true,
|
sizeChanged: true,
|
||||||
initFocused: true,
|
vsync: true,
|
||||||
|
initFocused: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
7
run.go
7
run.go
@ -153,9 +153,6 @@ func (i *imageDumperGameWithDraw) Layout(outsideWidth, outsideHeight int) (scree
|
|||||||
// TPS (ticks per second) is 60 by default.
|
// TPS (ticks per second) is 60 by default.
|
||||||
// This is not related to framerate (display's refresh rate).
|
// This is not related to framerate (display's refresh rate).
|
||||||
//
|
//
|
||||||
// game's Update is not called when the window is in background by default.
|
|
||||||
// This setting is configurable with SetRunnableOnUnfocused.
|
|
||||||
//
|
|
||||||
// On non-GopherJS environments, RunGame returns error when 1) OpenGL error happens, 2) audio error happens or
|
// On non-GopherJS environments, RunGame returns error when 1) OpenGL error happens, 2) audio error happens or
|
||||||
// 3) f returns error. In the case of 3), RunGame returns the same error.
|
// 3) f returns error. In the case of 3), RunGame returns the same error.
|
||||||
//
|
//
|
||||||
@ -286,8 +283,8 @@ func IsRunnableOnUnfocused() bool {
|
|||||||
|
|
||||||
// SetRunnableOnUnfocused sets the state if the game runs even in background.
|
// SetRunnableOnUnfocused sets the state if the game runs even in background.
|
||||||
//
|
//
|
||||||
// If the given value is true, the game runs in background e.g. when losing focus.
|
// If the given value is true, the game runs even in background e.g. when losing focus.
|
||||||
// The initial state is false.
|
// The initial state is true.
|
||||||
//
|
//
|
||||||
// Known issue: On browsers, even if the state is on, the game doesn't run in background tabs.
|
// Known issue: On browsers, even if the state is on, the game doesn't run in background tabs.
|
||||||
// This is because browsers throttles background tabs not to often update.
|
// This is because browsers throttles background tabs not to often update.
|
||||||
|
Loading…
Reference in New Issue
Block a user