Beispiel #1
0
        public void Draw(ITexture2D texture, Point location, float scale, Color color)
        {
            var gameTexture = (Texture)texture;

            _spriteBatch.Draw(gameTexture.Texture2D, new Vector2(location.X, location.Y), null, color, 0, Vector2.Zero,
                              scale, SpriteEffects.None, 0);
        }
Beispiel #2
0
 public void DrawRectangleOutline(Point location, Point size, Color color, int thickness = 1)
 {
     _spriteBatch.Draw(_whitePixelTexture, new Rectangle(location.X, location.Y, size.X, thickness), null, color,
                       0, Vector2.Zero, SpriteEffects.None, 0);
     _spriteBatch.Draw(_whitePixelTexture, new Rectangle(location.X, location.Y, thickness, size.Y), null, color,
                       0, Vector2.Zero, SpriteEffects.None, 0);
     _spriteBatch.Draw(_whitePixelTexture,
                       new Rectangle(location.X + size.X - thickness, location.Y, thickness, size.Y), null, color, 0,
                       Vector2.Zero, SpriteEffects.None, 0);
     _spriteBatch.Draw(_whitePixelTexture,
                       new Rectangle(location.X, location.Y + size.Y - thickness, size.X, thickness), null, color, 0,
                       Vector2.Zero, SpriteEffects.None, 0);
 }
Beispiel #3
0
 public void DrawRectangle(Point location, Point size, Color color)
 {
     _spriteBatch.Draw(_whitePixelTexture, new Rectangle(location.X, location.Y, size.X, size.Y), color);
 }
Beispiel #4
0
        public void Draw(ITexture2D texture, Point location, Color color)
        {
            var gameTexture = (Texture)texture;

            _spriteBatch.Draw(gameTexture.Texture2D, new Vector2(location.X, location.Y), color);
        }
Beispiel #5
0
 public void Draw(ITexture2D texture, Point location)
 {
     Draw(texture, location, Color.White);
 }
Beispiel #6
0
        public void DrawString(string text, FontSize fontSize, Point location, Color color)
        {
            var drawPosition = new Vector2(location.X, location.Y);

            _spriteBatch.DrawString(_fonts[fontSize], text, drawPosition, color);
        }
Beispiel #7
0
 public void DrawLineImmediate(Point start, int length, float angle, Color color)
 {
     _spriteBatch.Draw(_whitePixelTexture, new Rectangle(start.X, start.Y, length, 1), null, color, angle,
                       Vector2.Zero, SpriteEffects.None, 0);
 }