private POINT _Mirrored(POINT p) { if (!_CameraMirror) { return(p); } return(new POINT(_ScreenWidth - p.X, p.Y)); }
public virtual void DrawTo(ICanvas2D dc) { // draw rectangles foreach (var r in _Objects) { var rr = r.Rect; dc.DrawRectangle(rr, _GetColor(r.Name)); // draw score if (r.Area < 8 * 8) { continue; } if (!r.Score.IsValid) { continue; } if (r.Score.Value <= 0) { continue; } if (r.Score.Value > 1) { continue; } float x = rr.Location.X - 6; float y = rr.Location.Y + rr.Height; float s = r.Score.Value * (float)rr.Height; y -= s; dc.DrawLine((x, y), (x, y + s), 0.01f, COLOR.Green); } // draw lines foreach (var l in _DisplayLineIndices) { var a = _Objects[l.Item1].Rect; var b = _Objects[l.Item2].Rect; dc.DrawLine(POINT.Center(a), POINT.Center(b), 0.01f, COLOR.Green); } // draw text int row = 0; foreach (var item in this.Roots) { var s = item.Current.Score; if (s.Equals(SCORE.Ok)) { continue; } // dc.DrawFont() // yield return DisplayPrimitive.Write(s.IsValid ? COLOR.Green : COLOR.Red, (5, row), s.Value.ToString(), 10); row += 20; } }
public Vertex2(Point2 p) { Position = p.XY; Color = uint.MaxValue; TextureCoord = default; }
public Vertex2(Point2 p, Point2 t) { Position = p.XY; Color = uint.MaxValue; TextureCoord = t.XY; }
public Vertex2(Point2 p, ColorStyle c) { Position = p.XY; Color = c.Packed; TextureCoord = default; }
public Vertex2(Point2 p, ColorStyle c, Point2 t) { Position = p.XY; Color = c.Packed; TextureCoord = t.XY; }