Animation speed on different devices

2020-08-01 06:36发布

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,

2条回答
SAY GOODBYE
2楼-- · 2020-08-01 07:18

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

查看更多
淡お忘
3楼-- · 2020-08-01 07:26

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

查看更多
登录 后发表回答