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


C# IGraphic.DrawRectangle方法代码示例

本文整理汇总了C#中IGraphic.DrawRectangle方法的典型用法代码示例。如果您正苦于以下问题:C# IGraphic.DrawRectangle方法的具体用法?C# IGraphic.DrawRectangle怎么用?C# IGraphic.DrawRectangle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IGraphic的用法示例。


在下文中一共展示了IGraphic.DrawRectangle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ShowTowerShopPage

 /// <summary>
 /// Shows the tower shop page.
 /// </summary>
 /// <param name="graphObject">Graphic render object</param>
 private void ShowTowerShopPage(IGraphic graphObject)
 {
   ShopPageAction((int i, int j, int offset, int xMouse, int yMouse) =>
   {
     graphObject.DrawImage(_towerIcons[(CurrentShopPage - 1) * (Settings.LinesInOnePage * Settings.MaxTowersInLine) + offset],
       BuildRectPage(i, j));
     if (TowerConfSelectedID == (CurrentShopPage - 1) * (Settings.LinesInOnePage * Settings.MaxTowersInLine) + offset)
       //Border line
       graphObject.DrawRectangle(new Pen(Color.Red, Settings.PenWidth * Scaling), BuildRectPage(i, j));
     return false;
   });
 }
开发者ID:tupieurods,项目名称:tower-defense-csharp-opengl.gamelogic,代码行数:16,代码来源:TowerShop.cs

示例2: ShowPageSelector

 /// <summary>
 /// Shows the page selector.(Pages in shop)
 /// </summary>
 /// <param name="graphObject">Graphic render object</param>
 private void ShowPageSelector(IGraphic graphObject)
 {
   if (_towerIcons.Count > Settings.LinesInOnePage * Settings.MaxTowersInLine)
   {
     ShopPageSelectorAction((int i, int dy, int xMouse, int yMouse) =>
     {
       //String
       graphObject.DrawString("Page " + (i + 1).ToString(CultureInfo.InvariantCulture), new Font("Arial", 14 * Scaling), new SolidBrush(Color.Black),
         new Point(
           Convert.ToInt32((_paginatorPos.X + (i % ElementsDelta) * ("Page " + (i + 1).ToString(CultureInfo.InvariantCulture)).Length * Settings.PixelsForOneSymbol) * Scaling),
           Convert.ToInt32((_paginatorPos.Y + PaginatorElementHeight * dy) * Scaling)));
       //Border line
       Color penColor = ((i + 1) == CurrentShopPage) ? Color.Red : Color.White;
       graphObject.DrawRectangle(new Pen(penColor, Settings.PenWidth * Scaling), BuildRectPageSelector(i, dy));
       return false;
     });
   }
 }
开发者ID:tupieurods,项目名称:tower-defense-csharp-opengl.gamelogic,代码行数:22,代码来源:TowerShop.cs


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