From 429e0d818384f30ac0ef9ea091718602f936abb2 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sun, 15 Sep 2024 18:01:53 +0900 Subject: [PATCH] ebiten: refactoring --- cursor.go | 18 ++++++++++++++++++ run.go | 18 ------------------ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/cursor.go b/cursor.go index 68d2539db..051a301ae 100644 --- a/cursor.go +++ b/cursor.go @@ -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)) +} diff --git a/run.go b/run.go index 5cc703afd..561826a11 100644 --- a/run.go +++ b/run.go @@ -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.