本文整理汇总了C#中SpriteBatch.DrawRectangle方法的典型用法代码示例。如果您正苦于以下问题:C# SpriteBatch.DrawRectangle方法的具体用法?C# SpriteBatch.DrawRectangle怎么用?C# SpriteBatch.DrawRectangle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SpriteBatch
的用法示例。
在下文中一共展示了SpriteBatch.DrawRectangle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Draw
/// <summary>
/// Draws
/// </summary>
/// <param name="batch"></param>
public override void Draw(SpriteBatch batch)
{
base.Draw(batch);
// Display message
if (Hero == null)
{
batch.DrawString(GUI.MenuFont, new Point(26, 58), RectangleColor, Message);
}
else
{
//batch.DrawString(Camp.Font, new Point(16, 76), Color.White, "0 of 0 remaining.");
}
#region Draw heroes
for (int y = 0; y < 3; y++)
{
for (int x = 0; x < 2; x++)
{
Hero hero = GameScreen.Team.Heroes[y * 2 + x];
if (hero == null)
continue;
float col = (float)Math.Sin(1.0f);
batch.DrawRectangle(new Rectangle(366 + x * 144, 2 + y * 104, 130, 104), Color.White);
batch.DrawRectangle(new Rectangle(367 + x * 144, 4 + y * 104, 128, 101), Color.White);
}
}
#endregion
}
示例2: Draw
/// <summary>
/// Draws the window
/// </summary>
/// <param name="batch">Spritebatch handle</param>
public override void Draw(SpriteBatch batch)
{
base.Draw(batch);
Team team = GameScreen.Team;
// Display message
if (Hero == null)
{
batch.DrawString(GUI.MenuFont, new Point(26, 58), RectangleColor, Message);
}
else
{
batch.DrawString(GUI.MenuFont, new Point(16, 76), Color.White, "0 of 0 remaining.");
}
#region Draw heroes
for (int y = 0 ; y < 3 ; y++)
{
for (int x = 0 ; x < 2 ; x++)
{
Hero hero = team.Heroes[y * 2 + x];
if (hero == null)
continue;
// Draw rectangle around the hero
if (hero == Hero)
{
float col = (float)Math.Sin(1.0f);
batch.DrawRectangle(new Rectangle(366 + x * 144, 2 + y * 104, 130, 104), Color.White);
batch.DrawRectangle(new Rectangle(367 + x * 144, 4 + y * 104, 128, 101), Color.White);
}
else if (!hero.CheckClass(Filter))
{
// Ghost name
batch.DrawTile(Interface, 31, new Point(368 + 144 * x, y * 104 + 4));
}
}
}
#endregion
}