I have a simple translation animation in an Android game I am developing. When I test it on several devices, it runs at very different speeds on 10-inch tablets, 7-inch tablets and smartphones.
What is the "state of the art" way of getting a uniform animation speed on different devices?
Thanks,
I finally decided to use display.metrics to get the pixel density of the devices. Then I adjust the translation motion speed by dividing by the density value.
Still wondering if this is the "state of the art" way of controlling animation speed on various devices???
Animation duration should be same on all devices. But since the dimensions change, also the visual "distance" changes ad that's why you have an impression that the speed is different.
Possible solution for this is to switch between different screen sizes and set different animation duration for them
来源:https://stackoverflow.com/questions/19918823/animation-speed-on-different-devices