ui: Rename SetIcon to SetWindowIcon (#386)

This commit is contained in:
Hajime Hoshi 2017-09-23 17:40:09 +09:00
parent dacda0d176
commit 835d199f02
5 changed files with 13 additions and 12 deletions

View File

@ -134,7 +134,7 @@ func update(screen *ebiten.Image) error {
ebiten.SetCursorVisibility(cursorVisible) ebiten.SetCursorVisibility(cursorVisible)
if keyStates[ebiten.KeyI] == 1 { if keyStates[ebiten.KeyI] == 1 {
ebiten.SetIcon([]image.Image{createRandomIconImage()}) ebiten.SetWindowIcon([]image.Image{createRandomIconImage()})
} }
count++ count++
@ -173,7 +173,7 @@ func main() {
log.Fatal(err) log.Fatal(err)
} }
ebiten.SetIcon([]image.Image{createRandomIconImage()}) ebiten.SetWindowIcon([]image.Image{createRandomIconImage()})
if err := ebiten.Run(update, initScreenWidth, initScreenHeight, initScreenScale, "Window Size (Ebiten Demo)"); err != nil { if err := ebiten.Run(update, initScreenWidth, initScreenHeight, initScreenScale, "Window Size (Ebiten Demo)"); err != nil {
log.Fatal(err) log.Fatal(err)

View File

@ -277,7 +277,7 @@ func IsRunnableInBackground() bool {
return currentUI.isRunnableInBackground() return currentUI.isRunnableInBackground()
} }
func SetIcon(iconImages []image.Image) { func SetWindowIcon(iconImages []image.Image) {
if !currentUI.isRunning() { if !currentUI.isRunning() {
currentUI.setInitIconImages(iconImages) currentUI.setInitIconImages(iconImages)
return return

View File

@ -98,7 +98,7 @@ func SetCursorVisibility(visibility bool) {
} }
} }
func SetIcon(iconImages []image.Image) { func SetWindowIcon(iconImages []image.Image) {
// Do nothing // Do nothing
} }

View File

@ -141,7 +141,7 @@ func IsRunnableInBackground() bool {
return false return false
} }
func SetIcon(iconImages []image.Image) { func SetWindowIcon(iconImages []image.Image) {
// Do nothing // Do nothing
} }

15
run.go
View File

@ -247,9 +247,9 @@ func SetRunnableInBackground(runnableInBackground bool) {
ui.SetRunnableInBackground(runnableInBackground) ui.SetRunnableInBackground(runnableInBackground)
} }
// SetIcon sets the icon of the game window. // SetWindowIcon sets the icon of the game window.
// //
// If len(iconImages) is 0, SetIcon reverts the icon to the default one. // If len(iconImages) is 0, SetWindowIcon reverts the icon to the default one.
// //
// For desktops, see the document of glfwSetWindowIcon of GLFW 3.2: // For desktops, see the document of glfwSetWindowIcon of GLFW 3.2:
// //
@ -259,13 +259,14 @@ func SetRunnableInBackground(runnableInBackground bool) {
// If no images are specified, the window reverts to its default icon. // If no images are specified, the window reverts to its default icon.
// //
// The desired image sizes varies depending on platform and system settings. // The desired image sizes varies depending on platform and system settings.
// The selected images will be rescaled as needed. Good sizes include 16x16, 32x32 and 48x48. // The selected images will be rescaled as needed.
// Good sizes include 16x16, 32x32 and 48x48.
// //
// As macOS windows don't have icons, SetIcon doesn't work on macOS. // As macOS windows don't have icons, SetWindowIcon doesn't work on macOS.
// //
// SetIcon doesn't work on browsers or mobiles. // SetWindowIcon doesn't work on browsers or mobiles.
// //
// This function is concurrent-safe. // This function is concurrent-safe.
func SetIcon(iconImages []image.Image) { func SetWindowIcon(iconImages []image.Image) {
ui.SetIcon(iconImages) ui.SetWindowIcon(iconImages)
} }