Skip to main content
Tweeted twitter.com/#!/StackGameDev/status/238742522598395904
improved formatting
Source Link
bummzack
  • 22.7k
  • 5
  • 64
  • 87

I draw isometric map with tile 64x32:

const Offset = 160; int X, Y; for (int a=0; a < 6; a++) for (int b=0; b < 6; b++) { X = a * 32 - b * 32 + Offset; Y = a * 16 + b * 16; DrawTile(X, Y, tile); } 

Image, illustrating this code:

Image, illustrating this code:

Dear professionals, please, help with a formula of transformation of mouse coordinates in isometric indexes of a cell. Example: (105; 100) -> [1; 4].

Thanks.

P.S. Please excuse my bad English. I'm just learning...

I draw isometric map with tile 64x32:

const Offset = 160; int X, Y; for (int a=0; a < 6; a++) for (int b=0; b < 6; b++) { X = a * 32 - b * 32 + Offset; Y = a * 16 + b * 16; DrawTile(X, Y, tile); } 

Image, illustrating this code:

Image, illustrating this code:

Dear professionals, please, help with a formula of transformation of mouse coordinates in isometric indexes of a cell. Example: (105; 100) -> [1; 4].

Thanks.

P.S. Please excuse my bad English. I'm just learning...

I draw isometric map with tile 64x32:

const Offset = 160; int X, Y; for (int a=0; a < 6; a++) for (int b=0; b < 6; b++) { X = a * 32 - b * 32 + Offset; Y = a * 16 + b * 16; DrawTile(X, Y, tile); } 

Image, illustrating this code:

Image, illustrating this code:

Dear professionals, please, help with a formula of transformation of mouse coordinates in isometric indexes of a cell. Example: (105; 100) -> [1; 4].

I draw isometric map with tile 64x32:

const Offset = 160; int X, Y; for (int a=0; a < 6; a++) for (int b=0; b < 6; b++) { X = a * 32 - b * 32 + Offset; Y = a * 16 + b * 16; DrawTile(X, Y, tile); } 

Image, illustrating this code: http://i.imgur.com/tgCxF.png

Dear professionals, please, help with a formula of transformation of mouse coordinates in isometric indexes of a cell. Example: (105; 100) -> [1; 4].

Thanks.

P.S. Please excuse my bad English. I'm just learning...

I draw isometric map with tile 64x32:

const Offset = 160; int X, Y; for (int a=0; a < 6; a++) for (int b=0; b < 6; b++) { X = a * 32 - b * 32 + Offset; Y = a * 16 + b * 16; DrawTile(X, Y, tile); } 

Image, illustrating this code:

Image, illustrating this code:

Dear professionals, please, help with a formula of transformation of mouse coordinates in isometric indexes of a cell. Example: (105; 100) -> [1; 4].

Thanks.

P.S. Please excuse my bad English. I'm just learning...

I draw isometric map with tile 64x32:

const Offset = 160; int X, Y; for (int a=0; a < 6; a++) for (int b=0; b < 6; b++) { X = a * 32 - b * 32 + Offset; Y = a * 16 + b * 16; DrawTile(X, Y, tile); } 

Image, illustrating this code: http://i.imgur.com/tgCxF.png

Dear professionals, please, help with a formula of transformation of mouse coordinates in isometric indexes of a cell. Example: (105; 100) -> [1; 4].

Thanks.

P.S. Please excuse my bad English. I'm just learning...

I draw isometric map with tile 64x32:

const Offset = 160; int X, Y; for (int a=0; a < 6; a++) for (int b=0; b < 6; b++) { X = a * 32 - b * 32 + Offset; Y = a * 16 + b * 16; DrawTile(X, Y, tile); } 

Image, illustrating this code:

Image, illustrating this code:

Dear professionals, please, help with a formula of transformation of mouse coordinates in isometric indexes of a cell. Example: (105; 100) -> [1; 4].

Thanks.

P.S. Please excuse my bad English. I'm just learning...

Source Link
Alexan-Dwer
  • 313
  • 1
  • 2
  • 6

How to convert mouse coordinates to isometric indexes?

I draw isometric map with tile 64x32:

const Offset = 160; int X, Y; for (int a=0; a < 6; a++) for (int b=0; b < 6; b++) { X = a * 32 - b * 32 + Offset; Y = a * 16 + b * 16; DrawTile(X, Y, tile); } 

Image, illustrating this code: http://i.imgur.com/tgCxF.png

Dear professionals, please, help with a formula of transformation of mouse coordinates in isometric indexes of a cell. Example: (105; 100) -> [1; 4].

Thanks.

P.S. Please excuse my bad English. I'm just learning...