-
最近在研究大大的代码,斜45度地图的渲染这里看的有些头晕。不明白坐标都是如何计算的,还有resource/earth.002里的索引和index.ka里的坐标分别都是什么的索引啊。 |
Beta Was this translation helpful? Give feedback.
Answered by
benny502
May 27, 2022
Replies: 1 comment 1 reply
-
来自问自答吧,earth.002这些文件里的是素材的索引。理论上来讲,靠这里的索引已经能计算出素材的坐标 |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
godka
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
来自问自答吧,earth.002这些文件里的是素材的索引。理论上来讲,靠这里的索引已经能计算出素材的坐标
p.x = -y * TILE_W + x * TILE_W + render_center_x_; p.y = y * TILE_H + x * TILE_H + render_center_y_;
但是这些素材不知道为什么还有一定的坐标偏移,存在index.ka里,真正的显示坐标要用计算出来的坐标减去偏移坐标