Can someone please help me with this? I am trying to implement z-ordering into my map editor to determine
where a tile should be in a map, either in the background or the foreground. I use the left mouse button to
place each tile and it`s z-depth is set depending on the current layer I am working on in the editor, either
0 or 1 (background-foreground.) When it comes to the draw rountine I simple want the tiles with a z-depth of
0 (background) to be drawn first and then the tiles with a z-depth of 1 (foreground) to be drawn on the top of
the background 0 tiles. When using the following function I can draw the background ok then the foreground ok
but when I go back to drawing more background tiles, which should appear behind any placed foreground ones they
appear on top. This is not what I want but I cannot seem to find the problem :( Any help would be great.
Here`s the function.
Phew... Thanks,
Jason.
Function DrawTiles()
For Tile.Tiles=Each Tiles
Select Tile\ZOrder
Case 0
If MapLayerZeroEnabled=True
DrawBlock TileSet,Tile\XPosition,Tile\YPosition,Tile\Number
EndIf
Case 1
If MapLayerOneEnabled=True
DrawBlock TileSet,Tile\XPosition,Tile\YPosition,Tile\Number
EndIf
End Select
Next
End Function
where a tile should be in a map, either in the background or the foreground. I use the left mouse button to
place each tile and it`s z-depth is set depending on the current layer I am working on in the editor, either
0 or 1 (background-foreground.) When it comes to the draw rountine I simple want the tiles with a z-depth of
0 (background) to be drawn first and then the tiles with a z-depth of 1 (foreground) to be drawn on the top of
the background 0 tiles. When using the following function I can draw the background ok then the foreground ok
but when I go back to drawing more background tiles, which should appear behind any placed foreground ones they
appear on top. This is not what I want but I cannot seem to find the problem :( Any help would be great.
Here`s the function.
Phew... Thanks,
Jason.
Function DrawTiles()
For Tile.Tiles=Each Tiles
Select Tile\ZOrder
Case 0
If MapLayerZeroEnabled=True
DrawBlock TileSet,Tile\XPosition,Tile\YPosition,Tile\Number
EndIf
Case 1
If MapLayerOneEnabled=True
DrawBlock TileSet,Tile\XPosition,Tile\YPosition,Tile\Number
EndIf
End Select
Next
End Function