當前位置: 首頁>>代碼示例>>C#>>正文


C# WorldRenderer.DrawSelectionBox方法代碼示例

本文整理匯總了C#中OpenRA.Graphics.WorldRenderer.DrawSelectionBox方法的典型用法代碼示例。如果您正苦於以下問題:C# WorldRenderer.DrawSelectionBox方法的具體用法?C# WorldRenderer.DrawSelectionBox怎麽用?C# WorldRenderer.DrawSelectionBox使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在OpenRA.Graphics.WorldRenderer的用法示例。


在下文中一共展示了WorldRenderer.DrawSelectionBox方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: RenderAfterWorld

        public void RenderAfterWorld(WorldRenderer wr)
        {
            var bounds = self.Bounds.Value;

            var xy = new float2(bounds.Left, bounds.Top);
            var Xy = new float2(bounds.Right, bounds.Top);

            wr.DrawSelectionBox(self, Color.White);
            DrawHealthBar(self, xy, Xy);
            DrawExtraBars(self, xy, Xy);
            DrawUnitPath(self);
        }
開發者ID:nevelis,項目名稱:OpenRA,代碼行數:12,代碼來源:Selectable.cs

示例2: RenderAfterWorld

        public void RenderAfterWorld(WorldRenderer wr)
        {
            if (!Info.Selectable)
                return;

            var pos = wr.ScreenPxPosition(self.CenterPosition);
            var bounds = self.Bounds.Value;
            bounds.Offset(pos.X, pos.Y);

            var xy = new float2(bounds.Left, bounds.Top);
            var Xy = new float2(bounds.Right, bounds.Top);

            wr.DrawSelectionBox(self, Color.White);
            DrawHealthBar(wr, xy, Xy);
            DrawExtraBars(wr, xy, Xy);
            DrawUnitPath(wr);
        }
開發者ID:Generalcamo,項目名稱:OpenRA,代碼行數:17,代碼來源:Selectable.cs

示例3: RenderAfterWorld

 public void RenderAfterWorld( WorldRenderer wr, World world )
 {
     wr.DrawSelectionBox(self, Color.White);
 }
開發者ID:patthoyts,項目名稱:OpenRA,代碼行數:4,代碼來源:SetChronoTankDestination.cs

示例4: DrawInner

        public override void DrawInner( WorldRenderer wr )
        {
            var selbox = SelectionBox;
            if (selbox == null) return;

            var a = selbox.Value.First;
            var b = new float2(selbox.Value.Second.X - a.X, 0);
            var c = new float2(0, selbox.Value.Second.Y - a.Y);

            Game.Renderer.LineRenderer.DrawLine(a, a + b, Color.White, Color.White);
            Game.Renderer.LineRenderer.DrawLine(a + b, a + b + c, Color.White, Color.White);
            Game.Renderer.LineRenderer.DrawLine(a + b + c, a + c, Color.White, Color.White);
            Game.Renderer.LineRenderer.DrawLine(a, a + c, Color.White, Color.White);

            foreach (var u in SelectActorsInBox(world, selbox.Value.First, selbox.Value.Second))
                wr.DrawSelectionBox(u, Color.Yellow);
        }
開發者ID:patthoyts,項目名稱:OpenRA,代碼行數:17,代碼來源:WorldInteractionControllerWidget.cs

示例5: RenderAfterWorld

			public void RenderAfterWorld(WorldRenderer wr, World world)
			{
				var xy = wr.Viewport.ViewToWorld(Viewport.LastMousePos);
				foreach (var unit in power.UnitsInRange(xy))
					wr.DrawSelectionBox(unit, Color.Red);
			}
開發者ID:JackKucan,項目名稱:OpenRA,代碼行數:6,代碼來源:IronCurtainPower.cs

示例6: RenderAfterWorld

 public void RenderAfterWorld(WorldRenderer wr, World world)
 {
     var xy = Game.viewport.ViewToWorld(Viewport.LastMousePos);
     var targetUnits = power.UnitsInRange(xy);
     foreach (var unit in targetUnits)
         if (manager.self.Owner.Shroud.IsTargetable(unit) || manager.self.Owner.HasFogVisibility())
             wr.DrawSelectionBox(unit, Color.Red);
 }
開發者ID:TiriliPiitPiit,項目名稱:OpenRA,代碼行數:8,代碼來源:ChronoshiftPower.cs

示例7: RenderAfterWorld

            public void RenderAfterWorld(WorldRenderer wr, World world)
            {
                var units = FindUnitsInCircle(world, _sourceLocation, _range);

                foreach (var unit in units)
                {
                    wr.DrawSelectionBox(unit, Color.Yellow);
                }
            }
開發者ID:geckosoft,項目名稱:OpenRA,代碼行數:9,代碼來源:ChronoshiftPower.cs


注:本文中的OpenRA.Graphics.WorldRenderer.DrawSelectionBox方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。