0

我想将 1200x1000 像素的地图转换为 iPhone 屏幕坐标 (480x360),以便我可以对用户在屏幕上触摸的位置进行一些操作。因此,假设我在地图上找到了“玩家”,而他位于 1200x1000 的位置,那么我希望它与 iPhone 屏幕上的位置相对应:1200x1000 = 480x360。我可以使用哪些数学函数来完成此操作?

4

1 回答 1

2

Instead of hard coding the map and touch locations, I think it would be better if you can convert to a relative frame. I.e. say he is at location 1200x1000 and your map is 5000x5000, then you could convert that to (1200/5000)% x (1000/5000)% and multiply by the screen size.

于 2013-05-13T01:59:06.667 回答