ebiten: refactoring

This commit is contained in:
Hajime Hoshi 2024-09-15 18:01:53 +09:00
parent ab414558e8
commit 429e0d8183
2 changed files with 18 additions and 18 deletions

View File

@ -44,3 +44,21 @@ const (
CursorShapeMove CursorShapeType = CursorShapeType(ui.CursorShapeMove)
CursorShapeNotAllowed CursorShapeType = CursorShapeType(ui.CursorShapeNotAllowed)
)
// CursorShape returns the current cursor shape.
//
// CursorShape returns CursorShapeDefault on mobiles.
//
// CursorShape is concurrent-safe.
func CursorShape() CursorShapeType {
return CursorShapeType(ui.Get().CursorShape())
}
// SetCursorShape sets the cursor shape.
//
// If the platform doesn't implement the given shape, the default cursor shape is used.
//
// SetCursorShape is concurrent-safe.
func SetCursorShape(shape CursorShapeType) {
ui.Get().SetCursorShape(ui.CursorShape(shape))
}

18
run.go
View File

@ -409,24 +409,6 @@ func SetCursorMode(mode CursorModeType) {
ui.Get().SetCursorMode(ui.CursorMode(mode))
}
// CursorShape returns the current cursor shape.
//
// CursorShape returns CursorShapeDefault on mobiles.
//
// CursorShape is concurrent-safe.
func CursorShape() CursorShapeType {
return CursorShapeType(ui.Get().CursorShape())
}
// SetCursorShape sets the cursor shape.
//
// If the platform doesn't implement the given shape, the default cursor shape is used.
//
// SetCursorShape is concurrent-safe.
func SetCursorShape(shape CursorShapeType) {
ui.Get().SetCursorShape(ui.CursorShape(shape))
}
// IsFullscreen reports whether the current mode is fullscreen or not.
//
// IsFullscreen always returns false on mobiles.