2023-11-23 23:12:41 +03:00
|
|
|
package gg
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/hajimehoshi/ebiten/v2"
|
|
|
|
)
|
|
|
|
|
|
|
|
type MouseButton = ebiten.MouseButton
|
|
|
|
|
|
|
|
func (e *Engine) CursorPosition() Vector {
|
|
|
|
x, y := ebiten.CursorPosition()
|
|
|
|
return V(Float(x), Float(y))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e *Engine) AbsCursorPosition() Vector {
|
|
|
|
m := &Matrix{}
|
2023-12-20 22:39:33 +03:00
|
|
|
m.Concat(e.Camera().AbsMatrix())
|
2023-11-23 23:12:41 +03:00
|
|
|
return e.CursorPosition().Apply(m)
|
|
|
|
}
|
|
|
|
|