public void drawTile(Location tile, Location term, Graphics graph) { // Method 1 //graph.DrawImage(tileSet, new Rectangle(0, 0, TILE_SIZE, TILE_SIZE), new Rectangle(tile.col * TILE_SIZE, tile.row * TILE_SIZE, TILE_SIZE, TILE_SIZE), GraphicsUnit.Pixel); // Method 2 //graph.DrawImage(tileSet, // new Rectangle(term.col * tileSize, term.row * tileSize, tileSize, // tileSize), // new Rectangle(tile.col * tileSize, tile.row * tileSize, tileSize, tileSize), // GraphicsUnit.Pixel); // Method 3 graph.DrawImage(tiles[tile.col, tile.row], term.col * tileSize, term.row * tileSize); }
public void drawText(string text, Location term, Graphics graph) { drawText(text, term.col, term.row, graph); }
public void drawTile(int tileNum, Location term, Graphics graph) { int row = tileNum / NUM_TILES_ACROSS; int col = tileNum - (row * NUM_TILES_ACROSS); drawTile(new Location(col, row), term, graph); }
public void drawCharacter(char c, Location term, Graphics graph) { graph.DrawString(c.ToString(), font, Brushes.White, term.col * tileSize, term.row * tileSize); }