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


C# WorldRenderer.DrawRangeCircle方法代码示例

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


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

示例1: Render

		public void Render(WorldRenderer wr)
		{
			var wlr = Game.Renderer.WorldLineRenderer;
			var oldWidth = wlr.LineWidth;
			wlr.LineWidth = 3;
			wr.DrawRangeCircle(centerPosition, radius, contrastColor);
			wlr.LineWidth = 1;
			wr.DrawRangeCircle(centerPosition, radius, color);
			wlr.LineWidth = oldWidth;
		}
开发者ID:Roger-luo,项目名称:OpenRA,代码行数:10,代码来源:RangeCircleRenderable.cs

示例2: RenderAfterWorld

		public void RenderAfterWorld(WorldRenderer wr, Actor self)
		{
			foreach (var i in impacts)
			{
				var alpha = 255.0f * i.Time / info.DisplayDuration;
				var rangeStep = alpha / i.Range.Length;

				wr.DrawRangeCircle(i.CenterPosition, i.OuterRange, Color.FromArgb((int)alpha, Color.Red));

				foreach (var r in i.Range)
				{
					var tl = wr.ScreenPosition(i.CenterPosition - new WVec(r.Length, r.Length, 0));
					var br = wr.ScreenPosition(i.CenterPosition + new WVec(r.Length, r.Length, 0));
					var rect = RectangleF.FromLTRB(tl.X, tl.Y, br.X, br.Y);

					Game.Renderer.WorldLineRenderer.FillEllipse(rect, Color.FromArgb((int)alpha, Color.Red));

					alpha -= rangeStep;
				}

				if (!wr.World.Paused)
					i.Time--;
			}

			impacts.RemoveAll(i => i.Time == 0);
		}
开发者ID:Roger-luo,项目名称:OpenRA,代码行数:26,代码来源:WarheadDebugOverlay.cs

示例3: RenderAfterWorld

        public void RenderAfterWorld(WorldRenderer wr, Actor self)
        {
            if (devMode == null || !devMode.ShowMuzzles)
                return;

            if (health.Value != null)
                wr.DrawRangeCircle(Color.Red, wr.ScreenPxPosition(self.CenterPosition), health.Value.Info.Radius / Game.CellSize);

            var wlr = Game.Renderer.WorldLineRenderer;
            var c = Color.White;

            foreach (var a in armaments.Value)
            {
                foreach (var b in a.Barrels)
                {
                    var muzzle = self.CenterPosition + a.MuzzleOffset(self, b);
                    var dirOffset = new WVec(0, -224, 0).Rotate(a.MuzzleOrientation(self, b));

                    var sm = wr.ScreenPosition(muzzle);
                    var sd = wr.ScreenPosition(muzzle + dirOffset);
                    wlr.DrawLine(sm, sd, c, c);
                    wr.DrawTargetMarker(c, sm);
                }
            }
        }
开发者ID:Generalcamo,项目名称:OpenRA,代码行数:25,代码来源:CombatDebugOverlay.cs

示例4: RenderAfterWorld

        public void RenderAfterWorld(WorldRenderer wr, Actor self)
        {
            if (devMode == null || !devMode.ShowCombatGeometry)
                return;

            if (health.Value != null)
                wr.DrawRangeCircle(self.CenterPosition, health.Value.Info.Radius, Color.Red);

            // No armaments to draw
            if (attack.Value == null)
                return;

            var wlr = Game.Renderer.WorldLineRenderer;
            var c = Color.White;

            // Fire ports on garrisonable structures
            var garrison = attack.Value as AttackGarrisoned;
            if (garrison != null)
            {
                var bodyOrientation = coords.Value.QuantizeOrientation(self, self.Orientation);
                foreach (var p in garrison.Ports)
                {
                    var pos = self.CenterPosition + coords.Value.LocalToWorld(p.Offset.Rotate(bodyOrientation));
                    var da = coords.Value.LocalToWorld(new WVec(224, 0, 0).Rotate(WRot.FromYaw(p.Yaw + p.Cone)).Rotate(bodyOrientation));
                    var db = coords.Value.LocalToWorld(new WVec(224, 0, 0).Rotate(WRot.FromYaw(p.Yaw - p.Cone)).Rotate(bodyOrientation));

                    var o = wr.ScreenPosition(pos);
                    var a = wr.ScreenPosition(pos + da * 224 / da.Length);
                    var b = wr.ScreenPosition(pos + db * 224 / db.Length);
                    wlr.DrawLine(o, a, c, c);
                    wlr.DrawLine(o, b, c, c);
                }

                return;
            }

            foreach (var a in attack.Value.Armaments)
            {
                foreach (var b in a.Barrels)
                {
                    var muzzle = self.CenterPosition + a.MuzzleOffset(self, b);
                    var dirOffset = new WVec(0, -224, 0).Rotate(a.MuzzleOrientation(self, b));

                    var sm = wr.ScreenPosition(muzzle);
                    var sd = wr.ScreenPosition(muzzle + dirOffset);
                    wlr.DrawLine(sm, sd, c, c);
                    wr.DrawTargetMarker(c, sm);
                }
            }
        }
开发者ID:RunCraze,项目名称:OpenRA,代码行数:50,代码来源:CombatDebugOverlay.cs

示例5: RenderAfterWorld

        public void RenderAfterWorld(WorldRenderer wr, World world)
        {
            if (!self.IsInWorld)
                return;

            if (self.Owner != self.World.LocalPlayer)
                return;

            wr.DrawRangeCircle(
                Color.FromArgb(128, Color.DeepSkyBlue),
                wr.ScreenPxPosition(self.CenterPosition), (int)self.Trait<ChronoshiftDeploy>().Info.JumpDistance);
        }
开发者ID:TiriliPiitPiit,项目名称:OpenRA,代码行数:12,代码来源:ChronoshiftDeploy.cs

示例6: RenderBeforeWorld

        public void RenderBeforeWorld(WorldRenderer wr, World world)
        {
            if (!self.IsInWorld)
                return;

            if (self.Owner != self.World.LocalPlayer)
                return;

            wr.DrawRangeCircle(
                Color.FromArgb(128, Color.DeepSkyBlue),
                self.CenterLocation.ToFloat2(), (int)self.Trait<ChronoshiftDeploy>().Info.JumpDistance);
        }
开发者ID:VrKomarov,项目名称:OpenRA,代码行数:12,代码来源:ChronoshiftDeploy.cs

示例7: RenderBeforeWorld

 public void RenderBeforeWorld(WorldRenderer wr, World world)
 {
     wr.DrawRangeCircle(
         Color.FromArgb(128, Color.DeepSkyBlue),
         self.CenterLocation.ToFloat2(), (int)self.Trait<ChronoshiftDeploy>().Info.JumpDistance);
 }
开发者ID:hunnybunny95,项目名称:OpenRA,代码行数:6,代码来源:ChronoshiftDeploy.cs

示例8: RenderAfterWorld

            public void RenderAfterWorld( WorldRenderer wr, World world )
            {
                if (_lastMouseInput == null) return;

                var targetUnits = FindUnitsInCircle(world, Game.viewport.ViewToWorld(_lastMouseInput.Value).ToInt2(), info.Range);

                if (info.Range >= 1f)
                    wr.DrawRangeCircle(Color.Green, Game.viewport.Location + _lastMouseInput.Value.Location, info.Range - 0.5f);
            }
开发者ID:geckosoft,项目名称:OpenRA,代码行数:9,代码来源:ChronoshiftPower.cs


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