// Special Ledge Draw. Top section will use Ledge, rest will use LedgeDecor. private void DrawAutoTilesLedge(short left, short right, short top, short bottom) { byte ledgeTool = this.tileId; byte decorTool = (byte)TileEnum.LedgeDecor; // Draw Top of Ledge for (short x = left; x <= right; x++) { byte subType = this.GetSubTypeAtPosition(x, top); TileObject tgo = Systems.mapper.TileDict[ledgeTool]; tgo.Draw(null, subType, x * (byte)TilemapEnum.TileWidth - Systems.camera.posX, top * (byte)TilemapEnum.TileHeight - Systems.camera.posY); } // Draw Rest of Ledge (Decor) top += 1; for (short x = left; x <= right; x++) { for (short y = top; y <= bottom; y++) { byte subType = this.GetSubTypeAtPosition(x, y); TileObject tgo = Systems.mapper.TileDict[decorTool]; tgo.Draw(null, subType, x * (byte)TilemapEnum.TileWidth - Systems.camera.posX, y * (byte)TilemapEnum.TileHeight - Systems.camera.posY); } } }
// Restricts the dimensions of the AutoTile placement to the vertical axis. private void DrawAutoTilesVertical(short top, short bottom, short xLevel) { for (short y = top; y <= bottom; y++) { byte subType = this.GetSubTypeAtPosition(xLevel, y); TileObject tgo = Systems.mapper.TileDict[this.tileId]; tgo.Draw(null, subType, xLevel * (byte)TilemapEnum.TileWidth - Systems.camera.posX, y * (byte)TilemapEnum.TileHeight - Systems.camera.posY); } }
// Restricts the dimensions of the AutoTile placement to the horizontal axis. private void DrawAutoTilesHorizontal(short left, short right, short yLevel) { for (short x = left; x <= right; x++) { byte subType = this.GetSubTypeAtPosition(x, yLevel); TileObject tgo = Systems.mapper.TileDict[this.tileId]; tgo.Draw(null, subType, x * (byte)TilemapEnum.TileWidth - Systems.camera.posX, yLevel * (byte)TilemapEnum.TileHeight - Systems.camera.posY); } }
// Places a full X+Y grid. private void DrawAutoTilesFull(short left, short right, short top, short bottom) { for (short x = left; x <= right; x++) { for (short y = top; y <= bottom; y++) { // Get the SubType assigned for that auto-tile position, then draw it. byte subType = this.GetSubTypeAtPosition(x, y); TileObject tgo = Systems.mapper.TileDict[this.tileId]; tgo.Draw(null, subType, x * (byte)TilemapEnum.TileWidth - Systems.camera.posX, y * (byte)TilemapEnum.TileHeight - Systems.camera.posY); } } }