mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
ui: Rename SetIcon to SetWindowIcon (#386)
This commit is contained in:
parent
dacda0d176
commit
835d199f02
@ -134,7 +134,7 @@ func update(screen *ebiten.Image) error {
|
||||
ebiten.SetCursorVisibility(cursorVisible)
|
||||
|
||||
if keyStates[ebiten.KeyI] == 1 {
|
||||
ebiten.SetIcon([]image.Image{createRandomIconImage()})
|
||||
ebiten.SetWindowIcon([]image.Image{createRandomIconImage()})
|
||||
}
|
||||
|
||||
count++
|
||||
@ -173,7 +173,7 @@ func main() {
|
||||
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 {
|
||||
log.Fatal(err)
|
||||
|
@ -277,7 +277,7 @@ func IsRunnableInBackground() bool {
|
||||
return currentUI.isRunnableInBackground()
|
||||
}
|
||||
|
||||
func SetIcon(iconImages []image.Image) {
|
||||
func SetWindowIcon(iconImages []image.Image) {
|
||||
if !currentUI.isRunning() {
|
||||
currentUI.setInitIconImages(iconImages)
|
||||
return
|
||||
|
@ -98,7 +98,7 @@ func SetCursorVisibility(visibility bool) {
|
||||
}
|
||||
}
|
||||
|
||||
func SetIcon(iconImages []image.Image) {
|
||||
func SetWindowIcon(iconImages []image.Image) {
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
|
@ -141,7 +141,7 @@ func IsRunnableInBackground() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func SetIcon(iconImages []image.Image) {
|
||||
func SetWindowIcon(iconImages []image.Image) {
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
|
15
run.go
15
run.go
@ -247,9 +247,9 @@ func SetRunnableInBackground(runnableInBackground bool) {
|
||||
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:
|
||||
//
|
||||
@ -259,13 +259,14 @@ func SetRunnableInBackground(runnableInBackground bool) {
|
||||
// If no images are specified, the window reverts to its default icon.
|
||||
//
|
||||
// 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.
|
||||
func SetIcon(iconImages []image.Image) {
|
||||
ui.SetIcon(iconImages)
|
||||
func SetWindowIcon(iconImages []image.Image) {
|
||||
ui.SetWindowIcon(iconImages)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user