public void Draw(SpriteBatch batch) { if (IsAlive) { var color = Faction == Faction.Ally ? Color.Blue : Color.Red; batch.DrawRect(Position, 20, color); if (currentTarget != null) { if (!currentTarget.Faction.IsHostile(Faction)) color = Color.Green; var dir = currentTarget.Position - Position; //dir.Normalize(); dir *= (AP / 100); batch.DrawLine(Position, Position + dir, color, 2); } } }
void GoalDraw3072(SpriteBatch _spriteBatch) { _spriteBatch.DrawRect(popupRect, Color.DeepSkyBlue, 2.0f); _spriteBatch.DrawString(Assets.daFont, "Congratulations! You made it to 3072! Press Space to remove this message or R to restart.", new Vector2(popupRect.X, popupRect.Y), Color.White); }
void OverlayDraw(SpriteBatch _spriteBatch) { _spriteBatch.DrawRect(topHUDRect, Color.Orange); _spriteBatch.DrawString(Assets.daFont, "Score: " + gameBoard.Score, Vector2.Zero, Color.Black); _spriteBatch.DrawString(Assets.daFont, "Highscore: " + gameBoard.HighScore, new Vector2(GraphicsDevice.Viewport.Width - 200,0), Color.Black); }
void GameOverDraw(SpriteBatch _spriteBatch) { _spriteBatch.DrawRect(popupRect, Color.Red, 2.0f); _spriteBatch.DrawString(Assets.daFont, "Game Over! Press R to try again", new Vector2(popupRect.X,popupRect.Y), Color.Black); }
void GoalDraw2048(SpriteBatch _spriteBatch) { _spriteBatch.DrawRect(popupRect, Color.Lime, 2.0f); _spriteBatch.DrawString(Assets.daFont, "Congratulations! You made it to 2048! Press Space to remove this message or R to restart.", new Vector2(popupRect.X, popupRect.Y), Color.Black); }
protected override void OnDraw(GameTime time, SpriteBatch batch, Vector2 v2Offset) { if (_v2SelectionBoundInitial == s_v2OutOfBounds) return; var v2Start = CursorToFromWorld(_v2SelectionBoundInitial, false); var v2End = CursorPosition; batch.DrawRect(v2Start, v2End, Color.Yellow, 2); }
private void DrawBoundingBox(SpriteBatch spriteBatch, Camera camera, Color color, NonAxisAlignedBoundingBox box) { var blank = StateMachine.Owner.RenderManager.TextureCache.GetResource("blank"); spriteBatch.DrawRect(blank, box, 5, color); }
public void Draw(SpriteBatch _spriteBatch) { for (int i = 0; i < board.GetLength(0); i++) { for (int j = 0; j < board.GetLength(1); j++) { if (board[i, j] != 0) { _spriteBatch.DrawRect(tilesRectArr[i, j], colorHolder.GetColor(board[i,j]), 1); _spriteBatch.DrawString(Assets.daFont, "" + board[i, j], new Vector2((i * (boardConfig.tileWidth * scale)) + ((boardConfig.tileWidth * scale) / 3) + position.X, (j * (boardConfig.tileHeight * scale)) + ((boardConfig.tileHeight * scale) / 3) + position.Y), Color.Black); } } } }
public override void Draw(GameTime time, SpriteBatch batch) { batch.DrawRect(Tile.PositionRender, Tile.PositionRender + Vector2.One * Tile.TILE_SIZE); Sprite.Draw(batch, Rotation, s_v2RotationCenter, float.Epsilon); }
public override void Draw(SpriteBatch batch) { batch.DrawRect(Position - Size * 0.5f, Position + Size * 0.5f, Colour); batch.DrawText(Font, Label, Position, Colour.Invert(), true); }