0
그래서 나는이 방법 ....방법을 바꾸시겠습니까?
public static Vector2 cellsToIso(float row, float col) {
float halfTileWidth = tileWidth *0.5f;
float halfTileHeight = tileHeight *0.5f;
float x = (col * halfTileWidth) + (row * halfTileWidth);
float y = (row * halfTileHeight) - (col * halfTileHeight);
return new Vector2(x,y);
}
을하고 난 반대 방법 isoToCells(float x, float y)
나는이 시도를하고 싶지만, 그것은 나
public static Vector2 isoToCell(float x, float y) {
float halfTileWidth = tileWidth * 0.5f;
float halfTileHeight = tileHeight * 0.5f;
float row = (y/halfTileWidth) - (x/halfTileWidth);
float col = (x/halfTileHeight) + (y/halfTileHeight);
return new Vector2(row,col);
}
구체적인 문제를 명확히하거나 필요한 것을 정확하게 강조하기 위해 자세한 내용을 추가하십시오. 현재 작성된 내용이므로 귀하가 원하는 내용을 정확하게 말하기는 어렵습니다. –
왜 당신에게 이해가되지 않는 것을 시도 했습니까? – shmosel