hajimehoshi / ebiten

Ebitengine - A dead simple 2D game engine for Go
https://ebitengine.org
Apache License 2.0
11.09k stars 665 forks source link

inpututil: add a function to get the last touch position just before releasing #2057

Closed hajimehoshi closed 2 years ago

hajimehoshi commented 2 years ago

Requested by @midorimici

divVerent commented 2 years ago

Yes! I am currently emulating this myself with some hacky code.

hajimehoshi commented 2 years ago

If someone wants to work on this, please discuss what API we want before starting to implement it.

hajimehoshi commented 2 years ago

I'm still not sure what API would be the best. What about

func AppendJustReleasedTouchIDs(touchIDs []ebiten.TouchID) []ebiten.TouchID
func TouchPositionInPreviousTick(id ebiten.TouchID) (int, int, bool)

?

hajimehoshi commented 2 years ago

Treating touches as IDs itself seems a not good idea in the first place 🤔