The game consists of two coordination systems after applying the isometric map. One is the isometric map coordination and the other is the screen coordination. We often need to convert the coordination of a point between two systems when dealing with more than one coordination system.
For example, we may need to drag-and-drop some objects in the isometric map. When we press the object, we need to convert the screen position of the mouse to the isometric coordination. Then we will drag the object. The object follows the mouse position in screen coordination during the drag. After we drop the object, it is converted back from screen to isometric coordination so that it can align into the new position of the isometric map.
Let sx and sy be the screen x and y coordinate.
Let ix and iy be the isometric x and y coordinate.
We have already placed the isometric tiles properly, which means we are not far away from the isometric-to...