当前位置: 首页>>代码示例>>C#>>正文


C# SpriteBatch.DrawRectangle方法代码示例

本文整理汇总了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
		}
开发者ID:melkor54248,项目名称:dungeoneye,代码行数:35,代码来源:DropCharacterWindow.cs

示例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
		}
开发者ID:melkor54248,项目名称:dungeoneye,代码行数:45,代码来源:SpellWindow.cs


注:本文中的SpriteBatch.DrawRectangle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。