littlektframework / littlekt

A multiplatform WebGPU 2D game framework written in Kotlin. Build your own game engine on top.
https://littlekt.com
Apache License 2.0
314 stars 12 forks source link

Unexpected behavior mouseMoved and touchDragged #132

Closed TimerErTim closed 2 years ago

TimerErTim commented 2 years ago

Following methods from the InputProcessor are delivering the current positional arguments for the pointer device:

However, I think a better way would be to either deliver the delta value between the current and the last call or to provide both the current pointer position and the previous one.

image In this example, one could do the following:

inputCache.onMove(_deltaX, _deltaY, Pointer.POINTER1)
LeHaine commented 2 years ago

This is the expected behavior for those two callbacks. One could access the delta properties at the time the event is triggered in order to get the delta of the mouse position. input.deltaX and input.deltaY, return the _deltaX and _deltaY values so we would be getting the latest value even in the events.

TimerErTim commented 2 years ago

Thank you very much! You have written a great library combining the best of both Korge and KTX. I think this will be my goto 2d game engine for Kotlin. I am excited for the future development of littlekt.

LeHaine commented 2 years ago

Thanks and very glad to hear it! 😊