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


C# WorldRenderer.DrawRangeCircleWithContrast方法代碼示例

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


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

示例1: DrawRangeCircle

 public static void DrawRangeCircle(WorldRenderer wr, WPos pos, int range, Color color)
 {
     wr.DrawRangeCircleWithContrast(
         Color.FromArgb(128, color),
         wr.ScreenPxPosition(pos),
         range,
         Color.FromArgb(96, Color.Black));
 }
開發者ID:Generalcamo,項目名稱:OpenRA,代碼行數:8,代碼來源:RenderJammerCircle.cs

示例2: DrawRangeCircle

		public static void DrawRangeCircle(WorldRenderer wr, WPos pos, int range, Color color)
		{
			wr.DrawRangeCircleWithContrast(
				pos,
				WRange.FromCells(range),
				Color.FromArgb(128, color),
				Color.FromArgb(96, Color.Black)
			);
		}
開發者ID:Berzeger,項目名稱:OpenRA,代碼行數:9,代碼來源:RenderJammerCircle.cs

示例3: RenderAfterWorld

        public void RenderAfterWorld(WorldRenderer wr)
        {
            if (self.Owner != self.World.LocalPlayer)
                return;

            wr.DrawRangeCircleWithContrast(
                Color.FromArgb(128, Color.LimeGreen),
                wr.ScreenPxPosition(self.CenterPosition), self.Info.Traits.Get<DetectCloakedInfo>().Range,
                Color.FromArgb(96, Color.Black));
        }
開發者ID:Generalcamo,項目名稱:OpenRA,代碼行數:10,代碼來源:RenderDetectionCircle.cs

示例4: RenderAfterWorld

        // Range circle
        public void RenderAfterWorld(WorldRenderer wr)
        {
            // Visible to player and allies
            if (!ValidRenderPlayer())
                return;

            wr.DrawRangeCircleWithContrast(
                Color.FromArgb(128, Ready() ? Color.White : Color.Red),
                wr.ScreenPxPosition(self.CenterPosition), Info.Range,
                Color.FromArgb(96, Color.Black));
        }
開發者ID:Generalcamo,項目名稱:OpenRA,代碼行數:12,代碼來源:BaseProvider.cs

示例5: RenderAfterWorld

		public void RenderAfterWorld(WorldRenderer wr)
		{
			if (self.Owner != self.World.LocalPlayer)
				return;

			wr.DrawRangeCircleWithContrast(
				self.CenterPosition,
				self.Info.Traits.Get<CreatesShroudInfo>().Range,
				Color.FromArgb(128, Color.Cyan),
				Color.FromArgb(96, Color.Black)
			);
		}
開發者ID:JackKucan,項目名稱:OpenRA,代碼行數:12,代碼來源:RenderShroudCircle.cs

示例6: RenderAfterWorld

        public void RenderAfterWorld(WorldRenderer wr)
        {
            if (self.Owner != self.World.LocalPlayer)
                return;

            // Hack: Convert world coords to cells
            var pxRange = self.Trait<AttackBase>().GetMaximumRange().Range / 1024f;
            wr.DrawRangeCircleWithContrast(
                Color.FromArgb(128, Color.Yellow),
                wr.ScreenPxPosition(self.CenterPosition), pxRange,
                Color.FromArgb(96, Color.Black));
        }
開發者ID:Generalcamo,項目名稱:OpenRA,代碼行數:12,代碼來源:RenderRangeCircle.cs

示例7: Render

        public void Render(WorldRenderer wr, World w, ActorInfo ai, WPos centerPosition)
        {
            wr.DrawRangeCircleWithContrast(
                Color.FromArgb(128, Color.Cyan),
                wr.ScreenPxPosition(centerPosition),
                ai.Traits.Get<CreatesShroudInfo>().Range,
                Color.FromArgb(96, Color.Black));

            foreach (var a in w.ActorsWithTrait<RenderShroudCircle>())
                if (a.Actor.Owner == a.Actor.World.LocalPlayer)
                    a.Trait.RenderAfterWorld(wr);
        }
開發者ID:Generalcamo,項目名稱:OpenRA,代碼行數:12,代碼來源:RenderShroudCircle.cs

示例8: Render

        public void Render(WorldRenderer wr, World w, ActorInfo ai, WPos centerPosition)
        {
            wr.DrawRangeCircleWithContrast(
                Color.FromArgb(128, Color.Yellow), wr.ScreenPxPosition(centerPosition),
                ai.Traits.WithInterface<ArmamentInfo>()
                    .Select(a => Rules.Weapons[a.Weapon.ToLowerInvariant()].Range).Max(),
                Color.FromArgb(96, Color.Black));

            foreach (var a in w.ActorsWithTrait<RenderRangeCircle>())
                if (a.Actor.Owner == a.Actor.World.LocalPlayer)
                    if (a.Actor.Info.Traits.Get<RenderRangeCircleInfo>().RangeCircleType == RangeCircleType)
                        a.Trait.RenderAfterWorld(wr);
        }
開發者ID:Generalcamo,項目名稱:OpenRA,代碼行數:13,代碼來源:RenderRangeCircle.cs

示例9: RenderAfterWorld

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

            if (!self.Trait<PortableChrono>().Info.HasDistanceLimit)
                return;

            wr.DrawRangeCircleWithContrast(
                self.CenterPosition,
                WRange.FromCells(self.Trait<PortableChrono>().Info.MaxDistance),
                Color.FromArgb(128, Color.LawnGreen),
                Color.FromArgb(96, Color.Black)
            );
        }
開發者ID:RunCraze,項目名稱:OpenRA,代碼行數:15,代碼來源:PortableChrono.cs

示例10: RenderBeforeWorld

        // Range circle
        public void RenderBeforeWorld(WorldRenderer wr, Actor self)
        {
            // Visible to player and allies
            if (!self.Owner.IsAlliedWith(self.World.RenderPlayer))
                return;

            wr.DrawRangeCircleWithContrast(
                Color.FromArgb(128, Ready() ? Color.White : Color.Red),
                self.CenterLocation.ToFloat2(), Info.Range,
                Color.FromArgb(96, Color.Black), 1);
        }
開發者ID:Tsher,項目名稱:OpenRA,代碼行數:12,代碼來源:BaseProvider.cs


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