Esempio n. 1
0
 private void drawHex(LHGGrid grid, Hex hex)
 {
     grid.AddVertex(new Vector3(hex.Points[0].X, 0.0f, hex.Points[0].Y), hex.HexState.BackgroundColor);
     grid.AddVertex(new Vector3(hex.Points[1].X, 0.0f, hex.Points[1].Y), hex.HexState.BackgroundColor);
     grid.AddVertex(new Vector3(hex.Points[2].X, 0.0f, hex.Points[2].Y), hex.HexState.BackgroundColor);
     grid.AddVertex(new Vector3(hex.Points[3].X, 0.0f, hex.Points[3].Y), hex.HexState.BackgroundColor);
     grid.AddVertex(new Vector3(hex.Points[4].X, 0.0f, hex.Points[4].Y), hex.HexState.BackgroundColor);
     grid.AddVertex(new Vector3(hex.Points[5].X, 0.0f, hex.Points[5].Y), hex.HexState.BackgroundColor);
 }
Esempio n. 2
0
        public CombatBoard(LunchHourGames lhg, int hexSize, int width, int height,
                           int xOffset, int yOffset, int penWidth, bool isPointy, Color backgroundColor)
            : base(lhg)
        {
            this.lhg = lhg;
            this.gridNumbersVisible = false;

            this.grid = new LHGGrid(lhg);
            grid.LoadGraphicsContent(lhg.GraphicsDevice);

            initialize(lhg, hexSize, width, height, xOffset, yOffset, penWidth, isPointy, backgroundColor);
        }
Esempio n. 3
0
        public void Draw(LHGGrid grid)
        {
            // tell the grid to start drawing lines
            grid.Begin();

            //
            // Draw Hex Background
            //
            for (int i = 0; i < board.Hexes.GetLength(0); i++)
            {
                for (int j = 0; j < board.Hexes.GetLength(1); j++)
                {
                    drawHex(grid, board.Hexes[i, j]);
                }
            }

            // and we're done.
            grid.End();
        }