Animation speed on different devices

☆樱花仙子☆ 提交于 2019-12-10 00:40:48

问题


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,


回答1:


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???




回答2:


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!