public DrawLine ( |
||
batch | ||
width | float | |
color | Color | |
point1 | Vector2 | |
point2 | Vector2 | |
return | void |
public void DrawLine(SpriteBatch batch, float width, Color color, Vector2 point1, Vector2 point2)
{
float angle = (float)Math.Atan2(point2.Y - point1.Y, point2.X - point1.X);
float length = Vector2.Distance(point1, point2);
batch.Draw(_blank, point1, null, color,
angle, Vector2.Zero, new Vector2(length, width),
SpriteEffects.None, 0);
}