DrawPolygon() public method

public DrawPolygon ( float2 vertices, float width, Color color ) : void
vertices float2
width float
color Color
return void
Ejemplo n.º 1
0
 public void DrawCombatOverlay(WorldRenderer wr, RgbaColorRenderer wcr, Actor actor)
 {
     var verts = combatOverlayVerts.Select(v => wr.ScreenPosition(actor.CenterPosition + v.Rotate(actor.Orientation)));
     wcr.DrawPolygon(verts.ToArray(), 1, Color.Yellow);
 }
Ejemplo n.º 2
0
        public void DrawCombatOverlay(WorldRenderer wr, RgbaColorRenderer wcr, Actor actor)
        {
            var actorPos = actor.CenterPosition;
            var orientation = new WRot(actor.Orientation.Roll, actor.Orientation.Pitch,
                new WAngle(actor.Orientation.Yaw.Angle + (RotateToIsometry ? 128 : 0)));

            var targetablePositions = actor.TraitsImplementing<ITargetablePositions>();
            if (ApplyToAllTargetablePositions && targetablePositions.Any())
            {
                var positions = targetablePositions.SelectMany(tp => tp.TargetablePositions(actor));
                foreach (var pos in positions)
                {
                    var vertsTop = combatOverlayVertsTop.Select(v => wr.Screen3DPosition(pos + v.Rotate(orientation)));
                    var vertsBottom = combatOverlayVertsBottom.Select(v => wr.Screen3DPosition(pos + v.Rotate(orientation)));
                    wcr.DrawPolygon(vertsTop.ToArray(), 1, Color.Yellow);
                    wcr.DrawPolygon(vertsBottom.ToArray(), 1, Color.Yellow);
                }
            }
            else
            {
                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);
            }
        }