Gruppe22.Client.Mainmap._pos2Tile C# (CSharp) Method

_pos2Tile() public static method

Determine tile based on coordinates of point
public static _pos2Tile ( Vector2 coords, bool tall = false ) : Backend.Coords
coords Vector2
tall bool
return Backend.Coords
        public static Backend.Coords _pos2Tile(Vector2 coords, bool tall = false)
        {
            // TODO: This does not work perfectly yet. Check the formula!
            coords.X -= 32;
            coords.Y -= 48;
            return new Backend.Coords((int)(coords.X / 128 - coords.Y / 96)
                                    , (int)(coords.X / 128 + coords.Y / 96));
        }