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


C# CSharpFramework.TouchesSelectionMarquee方法代码示例

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


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

示例1: OnPaintScene2DView

        public override void OnPaintScene2DView(CSharpFramework.Controls.Scene2DView view, PaintEventArgs e)
        {
            if (SectorVisibleMask == 0)
            return;
              if (_bViewBitmapDirty)
              {
            UpdatePreviewBitmap();
            _bViewBitmapDirty = false;
              }
              if (_2dViewBitmap != null)
              {
            BoundingBox sectorBBox = SectorExtent;
            Point p1 = view.Transform(sectorBBox.vMin);
            Point p2 = view.Transform(sectorBBox.vMax);

            Rectangle dst = view.MakeValidRect(p1, p2);
            // darker images for unloaded sectors
            _2dViewAttr.SetGamma(CurrentStatus == SectorAction.Reloaded ? 1.0f : 4.0f);
            e.Graphics.DrawImage(_2dViewBitmap, dst, 0, _2dViewBitmapResolution - 1, _2dViewBitmapResolution, -_2dViewBitmapResolution, GraphicsUnit.Pixel, _2dViewAttr); // flip vertically

            // inside selection? then overlay with color
            if (view.TouchesSelectionMarquee(sectorBBox))
              e.Graphics.FillRectangle(_selectionFill, dst);

            _pen.Color = Color.Turquoise;
            if (CurrentStatus == SectorAction.Modified) _pen.Color = Color.Orange;
            if (CurrentStatus == SectorAction.Reloaded) _pen.Color = Color.Magenta;

            dst.Location = new Point(p1.X, p2.Y);
            dst.Size = new Size(p2.X - p1.X, p1.Y - p2.Y);
            e.Graphics.DrawRectangle(_pen, dst);

            //Display terrain status
            // Locked, Modified, Unmodified

            if (_ownerTerrain.EngineTerrain.GetSectorNetworkLock(_iSectorX, _iSectorY))
            {
              dst.Width = 10;
              dst.Height = 10;
              _pen.Color = Color.Red;
              e.Graphics.DrawRectangle(_pen, dst);
            }

            if (_ownerTerrain.EngineTerrain.GetSectorOwnsLock(_iSectorX, _iSectorY))
            {
              dst.Width = 10;
              dst.Height = 10;
              _pen.Color = Color.Green;
              e.Graphics.DrawRectangle(_pen, dst);
            }
              }
              else
            base.OnPaintScene2DView(view, e);

              if (FilterCollisionCat != null && FilterCollisionCat.Enabled)
              {
            if (SectorCollisionMask > 0)
            {
              BoundingBox sectorBBox = SectorExtent;
              Point p1 = view.Transform(sectorBBox.vMin);
              Point p2 = view.Transform(sectorBBox.vMax);

              Rectangle dst = view.MakeValidRect(p1, p2);
              e.Graphics.DrawString("C", _font, Brushes.White, dst);
            }
              }
        }
开发者ID:romance-ii,项目名称:projectanarchy,代码行数:67,代码来源:TerrainVisibilityZoneShape.cs


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