void IRenderAboveWorld.RenderAboveWorld(Actor self, WorldRenderer wr) { foreach (var i in impacts) { var alpha = 255.0f * i.Time / info.DisplayDuration; var rangeStep = alpha / i.Range.Length; RangeCircleRenderable.DrawRangeCircle(wr, i.CenterPosition, i.OuterRange, 1, Color.FromArgb((int)alpha, i.Color), 0, i.Color); foreach (var r in i.Range) { var tl = wr.Screen3DPosition(i.CenterPosition - new WVec(r.Length, r.Length, 0)); var br = wr.Screen3DPosition(i.CenterPosition + new WVec(r.Length, r.Length, 0)); Game.Renderer.WorldRgbaColorRenderer.FillEllipse(tl, br, Color.FromArgb((int)alpha, i.Color)); alpha -= rangeStep; } if (!wr.World.Paused) { i.Time--; } } impacts.RemoveAll(i => i.Time == 0); }
public void DrawCombatOverlay(WorldRenderer wr, RgbaColorRenderer wcr, Actor actor) { var actorPos = actor.CenterPosition; var a = actorPos + new WVec(PointA.X, PointA.Y, VerticalTopOffset).Rotate(actor.Orientation); var b = actorPos + new WVec(PointB.X, PointB.Y, VerticalTopOffset).Rotate(actor.Orientation); var aa = actorPos + new WVec(PointA.X, PointA.Y, VerticalBottomOffset).Rotate(actor.Orientation); var bb = actorPos + new WVec(PointB.X, PointB.Y, VerticalBottomOffset).Rotate(actor.Orientation); var offset1 = new WVec(a.Y - b.Y, b.X - a.X, 0); offset1 = offset1 * Radius.Length / offset1.Length; var offset2 = new WVec(aa.Y - bb.Y, bb.X - aa.X, 0); offset2 = offset2 * Radius.Length / offset2.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 - offset1), wr.ScreenPosition(b - offset1) }, 1, c); wcr.DrawLine(new[] { wr.ScreenPosition(a + offset1), wr.ScreenPosition(b + offset1) }, 1, c); RangeCircleRenderable.DrawRangeCircle(wr, aa, Radius, 1, c, 0, c); RangeCircleRenderable.DrawRangeCircle(wr, bb, Radius, 1, c, 0, c); wcr.DrawLine(new[] { wr.ScreenPosition(aa - offset2), wr.ScreenPosition(bb - offset2) }, 1, c); wcr.DrawLine(new[] { wr.ScreenPosition(aa + offset2), wr.ScreenPosition(bb + offset2) }, 1, c); }
public void DrawCombatOverlay(WorldRenderer wr, RgbaColorRenderer wcr, Actor actor) { var actorPos = actor.CenterPosition; RangeCircleRenderable.DrawRangeCircle( wr, actorPos + new WVec(0, 0, VerticalTopOffset), Radius, 1, Color.Yellow, 0, Color.Yellow); RangeCircleRenderable.DrawRangeCircle( wr, actorPos + new WVec(0, 0, VerticalBottomOffset), Radius, 1, Color.Yellow, 0, Color.Yellow); }
public void DrawCombatOverlay(WorldRenderer wr, RgbaColorRenderer wcr, Actor actor) { var actorPos = actor.CenterPosition; var orientation = actor.Orientation + WRot.FromYaw(LocalYaw); var vertsTop = combatOverlayVertsTop.Select(v => wr.Screen3DPosition(actorPos + v.Rotate(orientation))); var vertsBottom = combatOverlayVertsBottom.Select(v => wr.Screen3DPosition(actorPos + v.Rotate(orientation))); wcr.DrawPolygon(vertsTop.ToArray(), 1, Color.Yellow); wcr.DrawPolygon(vertsBottom.ToArray(), 1, Color.Yellow); RangeCircleRenderable.DrawRangeCircle(wr, actorPos, OuterRadius, 1, Color.LimeGreen, 0, Color.LimeGreen); }
void IRenderAboveWorld.RenderAboveWorld(Actor self, WorldRenderer wr) { if (Info.Visible == RangeCircleVisibility.Always && Visible) { RangeCircleRenderable.DrawRangeCircle( wr, self.CenterPosition, Info.Range, 1, Info.UsePlayerColor ? self.Owner.Color.RGB : Info.Color, 3, Color.FromArgb(96, Color.Black)); } }
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); }
public void DrawCombatOverlay(WorldRenderer wr, RgbaColorRenderer wcr, Actor actor) { RangeCircleRenderable.DrawRangeCircle(wr, actor.CenterPosition, Radius, 1, Color.Yellow, 0, Color.Yellow); }