And if you want to get the coordinates of where to draw an ISO tile onto the screen by the X and Y of the ISO tile, heres how to do that:
Code:This will give you the coordinates of this point where the X is: X######################################### # 0 # # 0 0 # # 0 0 # # 0 0 # # 0 0 # # 0 0 # # 0 # ########################################## The #'s make up the box around the iso tile, and the 0's make up the iso tile. The X is where the coordinates to draw are.VB Code:
'TileX and TileY is the iso tile coords, 'for example, 0,0, 0,1, 3,3, etc. 'Usually goes to about 16,16. 'NewX and NewY are the X and Y coords 'On the screen, of the top left of an iso 'tile, which is where you would draw the tile 'Set the new X to the middle of the screen NewX = SCREENW / 2 'Move the new X to the left, by half the width of a tile NewX -= TILEW / 2 'Set the new Y to 0 (top of the screen) NewY = 0 'Increase the newX by half the tile width multiplied by the ISO tile X NewX += TileX * (TILEW/2) 'Increase the newY by half the tile height multiplied by the ISO tile X NewY += TileX * (TILEH/2) 'Increase the newX by half the tile width multiplied by the ISO tile y NewX -= TileY * (TILEW/2) 'Increase the newY by the tile height multiplied by the ISO tile y NewY += TileY * TileH 'Optional: If your sprites vary in Height: 'Decrease the newY by any height past the regular tile height NewY -= Sprites(SpriteID).SurfaceDescription.Height - TILEH





Reply With Quote