n4archive / pigame

A pygame wrapper for the libary pitft_touchscreen.
GNU Lesser General Public License v3.0
6 stars 1 forks source link

Fix the rel in MOUSEMOTION #2

Closed nift4 closed 5 years ago

nift4 commented 5 years ago

I don't know what rel is doing (and Google also don't really know) and its set to (0,0) in pigame. Any help or pull request whould be nice :)

BroMarduk commented 5 years ago

'rel' in the MOUSEMOTION event is the relative movement from previous mouse move/down event. So if the previous event occurred at (10,10) and a move to (4, 18) occurred next, the call to get_rel would be (-6, 8) in pygame. If no movement occurred since the last message, the next call to get_rel would (or should return (0,0).

My new sample code in Issue #1 (https://github.com/pigamedrv/pigame/issues/1) includes what should be the proper rel data in the event (still testing :))

https://www.pygame.org/docs/ref/mouse.html#pygame.mouse.get_rel

nift4 commented 5 years ago

Can I do rel = (newx - oldx,newy - oldy)? I think so but I'm not sure.

BroMarduk commented 5 years ago

Basically, yes, that's all it is. It just makes it easier to tell if the last motion occurred on one of the same planes or at an angle to the previous motion.

nift4 commented 5 years ago

Fixed in c3abd01

nift4 commented 5 years ago

MoreFNC fixed in 1961800