Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 public void drawText(string text, Location term, Graphics graph)
 {
     drawText(text, term.col, term.row, graph);
 }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
 public void drawCharacter(char c, Location term, Graphics graph)
 {
     graph.DrawString(c.ToString(), font, Brushes.White, term.col * tileSize, term.row * tileSize);
 }