gg/mouse.go
2023-12-23 00:09:07 +03:00

19 lines
341 B
Go

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{}
m.Concat(e.Camera.AbsMatrix())
return e.CursorPosition().Apply(m)
}