Probably best to use a physics library, if you’re dealing with a large collection of rectangles. Something like http://gitorious.org/qml-box2d for example.
If you want to do it manually, you can write custom deceleration animations on the x/y properties proportional to the horizontal/vertical components of the vector of movement at the time of mouse-button release, I guess. You may have to collect mouse (or touch) event data over time to do the vector calculation, though, I’m not sure.
Cheers,
Chris.
↧