OpenRA.Graphics.RgbaColorRenderer.DrawLine C# (CSharp) Method

DrawLine() public method

public DrawLine ( IEnumerable points, float width, Color color, bool connectSegments = false ) : void
points IEnumerable
width float
color Color
connectSegments bool
return void
        public void DrawLine(IEnumerable<float2> points, float width, Color color, bool connectSegments = false)
        {
            DrawLine(points.Select(p => new float3(p, 0)), width, color, connectSegments);
        }

Same methods

RgbaColorRenderer::DrawLine ( IEnumerable points, float width, Color color, bool connectSegments = false ) : void
RgbaColorRenderer::DrawLine ( float3 start, float3 end, float width, Color color ) : void
RgbaColorRenderer::DrawLine ( float3 start, float3 end, float width, Color startColor, Color endColor ) : void

Usage Example

Example #1
0
        public void DrawCombatOverlay(WorldRenderer wr, RgbaColorRenderer wcr, Actor actor)
        {
            var a = actor.CenterPosition + new WVec(PointA.X, PointA.Y, 0).Rotate(actor.Orientation);
            var b = actor.CenterPosition + new WVec(PointB.X, PointB.Y, 0).Rotate(actor.Orientation);

            var offset = new WVec(a.Y - b.Y, b.X - a.X, 0);
            offset = offset * Radius.Length / offset.Length;

            var c = Color.Yellow;
            RangeCircleRenderable.DrawRangeCircle(wr, a, Radius, 1, c, 0, c);
            RangeCircleRenderable.DrawRangeCircle(wr, b, Radius, 1, c, 0, c);
            wcr.DrawLine(new[] { wr.ScreenPosition(a - offset), wr.ScreenPosition(b - offset) }, 1, c);
            wcr.DrawLine(new[] { wr.ScreenPosition(a + offset), wr.ScreenPosition(b + offset) }, 1, c);
        }
All Usage Examples Of OpenRA.Graphics.RgbaColorRenderer::DrawLine