public override void LoadContent(ContentManager content) { base.LoadContent(content); spriteBatch = new SpriteBatch(Device); primBatch = new PrimitiveBatch2D(Device); }
public void Draw(GameTime g, SpriteBatch spriteBatch, PrimitiveBatch2D primBatch) { for (int i = 0; i < tiers.Count; i++) { for (int j = 0; j < tiers[i].Length; j++) { if (tiers[i][j] == null) { continue; } tiers[i][j].Draw(g, spriteBatch, primBatch); } } }
public void Draw(GameTime g, SpriteBatch spriteBatch, PrimitiveBatch2D primBatch) { if (available & points==0) { primBatch.FillQuad(new Vector3(Pos.X - Dim.X, Pos.Y + Dim.Y, 0), new Vector3(Pos.X + Dim.X, Pos.Y + Dim.Y, 0), new Vector3(Pos.X + Dim.X, Pos.Y - Dim.Y, 0), new Vector3(Pos.X - Dim.X, Pos.Y - Dim.Y, 0), Color.White); } else if (available & points > 0 & points < mp) { primBatch.FillQuad(new Vector3(Pos.X - Dim.X, Pos.Y + Dim.Y, 0), new Vector3(Pos.X + Dim.X, Pos.Y + Dim.Y, 0), new Vector3(Pos.X + Dim.X, Pos.Y - Dim.Y, 0), new Vector3(Pos.X - Dim.X, Pos.Y - Dim.Y, 0), Color.Yellow); } else if (available & points == mp) { primBatch.FillQuad(new Vector3(Pos.X - Dim.X, Pos.Y + Dim.Y, 0), new Vector3(Pos.X + Dim.X, Pos.Y + Dim.Y, 0), new Vector3(Pos.X + Dim.X, Pos.Y - Dim.Y, 0), new Vector3(Pos.X - Dim.X, Pos.Y - Dim.Y, 0), Color.DarkOrange); } else { primBatch.FillQuad(new Vector3(Pos.X - Dim.X, Pos.Y + Dim.Y, 0), new Vector3(Pos.X + Dim.X, Pos.Y + Dim.Y, 0), new Vector3(Pos.X + Dim.X, Pos.Y - Dim.Y, 0), new Vector3(Pos.X - Dim.X, Pos.Y - Dim.Y, 0), Color.Gray); } }