0
So habe ich diese Methode ....Eine Methode umkehren?
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);
}
und ich möchte auf der Rückseite Methode isoToCells(float x, float y)
ich das versucht, aber es funktioniert nicht für mich Sinn
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);
}
Bitte klären Sie Ihr spezifisches Problem oder fügen Sie weitere Details hinzu, um genau zu markieren, was Sie brauchen. Wie es derzeit geschrieben wird, ist es schwer zu sagen, was genau Sie fragen. –
Warum hast du etwas versucht, das für dich keinen Sinn ergibt? – shmosel