本文整理汇总了C#中Microsoft.Xna.Framework.Rectangle.DrawOutline方法的典型用法代码示例。如果您正苦于以下问题:C# Rectangle.DrawOutline方法的具体用法?C# Rectangle.DrawOutline怎么用?C# Rectangle.DrawOutline使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Xna.Framework.Rectangle
的用法示例。
在下文中一共展示了Rectangle.DrawOutline方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Draw
/// <summary>
/// Draws this triangle to the screen.
/// </summary>
/// <param name="debug">Draws some useful debug information.</param>
public void Draw(bool debug)
{
GameServices.SpriteBatch.DrawLine(1f, Color.White, Point90, Point1);
GameServices.SpriteBatch.DrawLine(1f, Color.White, Point90, Point2);
GameServices.SpriteBatch.DrawLine(1f, Color.White, Point1, Point2);
if (debug)
{
// Draw the line coincident to the slope. For the inverted
// Y-axis, the slope-intercept formula, solved for x, is x = (-y
// + b) / m
Vector2 screenSize = GameServices.ScreenSize;
Vector2 lineStart = new Vector2((-screenSize.Y + YIntersect) / Slope, screenSize.Y);
Vector2 lineEnd = new Vector2(YIntersect / Slope, 0f);
GameServices.SpriteBatch.DrawLine(1f, Color.ForestGreen, lineStart, lineEnd);
// DrawLine is a little weird with drawing the right-triangle -
// the bounds look visually larger than the triangle, even though
// they are the right sizes. So we'll correct the bounds so they
// look right.
Rectangle drawBounds = new Rectangle((int)Bounds.X + 1, (int)Bounds.Y - 1, (int)Bounds.Width, (int)Bounds.Height);
drawBounds.DrawOutline(Color.Red);
// Draw some useful debug information.
GameServices.DebugFont.DrawString(ToString(), new Vector2(Bounds.X, Bounds.Y));
}
}