mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
ui: Deprecate SetCursorVisibility and add SetCursorVisible (#407)
This commit is contained in:
parent
5c55df87d7
commit
38c72faf95
@ -131,7 +131,7 @@ func update(screen *ebiten.Image) error {
|
||||
ebiten.SetScreenScale(screenScale)
|
||||
ebiten.SetFullscreen(fullscreen)
|
||||
ebiten.SetRunnableInBackground(runnableInBackground)
|
||||
ebiten.SetCursorVisibility(cursorVisible)
|
||||
ebiten.SetCursorVisible(cursorVisible)
|
||||
|
||||
if keyStates[ebiten.KeyI] == 1 {
|
||||
ebiten.SetWindowIcon([]image.Image{createRandomIconImage()})
|
||||
|
@ -345,7 +345,7 @@ func IsCursorVisible() bool {
|
||||
return v
|
||||
}
|
||||
|
||||
func SetCursorVisibility(visible bool) {
|
||||
func SetCursorVisible(visible bool) {
|
||||
u := currentUI
|
||||
if !u.isRunning() {
|
||||
u.setInitCursorVisible(visible)
|
||||
|
@ -86,8 +86,8 @@ func IsCursorVisible() bool {
|
||||
return canvas.Get("style").Get("cursor").String() != "none"
|
||||
}
|
||||
|
||||
func SetCursorVisibility(visibility bool) {
|
||||
if visibility {
|
||||
func SetCursorVisible(visible bool) {
|
||||
if visible {
|
||||
canvas.Get("style").Set("cursor", "auto")
|
||||
} else {
|
||||
canvas.Get("style").Set("cursor", "none")
|
||||
|
@ -162,7 +162,7 @@ func IsCursorVisible() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func SetCursorVisibility(visibility bool) {
|
||||
func SetCursorVisible(visible bool) {
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
|
11
run.go
11
run.go
@ -187,13 +187,18 @@ func IsCursorVisible() bool {
|
||||
return ui.IsCursorVisible()
|
||||
}
|
||||
|
||||
// SetCursorVisibility changes the state of cursor visiblity.
|
||||
// SetCursorVisible changes the state of cursor visiblity.
|
||||
//
|
||||
// SetCursorVisibility does nothing on mobiles.
|
||||
// SetCursorVisible does nothing on mobiles.
|
||||
//
|
||||
// This function is concurrent-safe.
|
||||
func SetCursorVisible(visible bool) {
|
||||
ui.SetCursorVisible(visible)
|
||||
}
|
||||
|
||||
// SetCursorVisibility is deprecated as of 1.6.0-alpha. Use SetCursorVisible instead.
|
||||
func SetCursorVisibility(visible bool) {
|
||||
ui.SetCursorVisibility(visible)
|
||||
SetCursorVisible(visible)
|
||||
}
|
||||
|
||||
// IsFullscreen returns a boolean value indicating whether
|
||||
|
Loading…
Reference in New Issue
Block a user