ここに示すように、hextiled マップを作成しようとしています。
http://files.slembcke.net/misc/procedural/hex_tiles.png
しかし、リスト内のタイル X(行) および Y(列) インデックスを画面位置に変換する関数に問題があります。
public static Vector2 GetDisplayCoordOfTile(GameTile t, Texture2D texture)
{
Vector2 screenPadding = new Vector2(2, 2);
float ypos = (t.Column * (texture.Height + 2)) - (t.Row * texture.Height / (float)2) + screenPadding.Y;
float xpos = (t.Row * (texture.Width)) + screenPadding.X;
return new Vector2(xpos, ypos);
}
座標系は通常の配列での考え方とは異なるため、物事がうまくいかない手がかりを誰かに持っていますか?