Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I asked this on stackoverflow but did not receive an answer:

In a very simple Libgdx game, which only consists of single image being dragged along with mouse, I notice that the object always lag behind the mouse.

I have checked it in various situations (with actor, without actor, with box2d, etc.) but the behavior is always the same.

Is there a way to make object move with exact speed of mouse movement?

share|improve this question
    
How far behind? It's normal that your engine logic and windows drawing isn't 100% synced. –  William 'MindWorX' Mariager Jul 14 '12 at 4:56
    
If I move the mouse fast enough, there can be 20-30 centimeters gap! And after that, if I let the mouse rest, the object will catch up. –  Z0lenDer Jul 14 '12 at 8:07
    
Have you tried measuring the FPS of your engine? Sounds like you're doing something weird, although, even an engine running at the same rate as the monitor will have a delay. Hardware cursor will always be smoother than software cursor, which is why you should never show both. –  William 'MindWorX' Mariager Jul 14 '12 at 14:15
    
Thanks. I'll test and post the results. –  Z0lenDer Jul 14 '12 at 18:40
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.