protected override void RenderSelf (GXPEngine.Core.GLContext glContext) { if (_invalidate) { graphics.Clear (backgroundColor); if (_borderSize > 0 && _borderColor != Color.Empty) { graphics.DrawRectangle (_borderPen, 0, 0, width, height); } graphics.DrawString (_text, _font, _textBrush, 0, 0); } base.RenderSelf (glContext); }
protected override void RenderSelf (GXPEngine.Core.GLContext glContext) { if (_startPoint == null || _vector == null) return; Vec2 endPoint = _startPoint.Clone().Add (_vector.Clone().Scale (scale)); LineSegment.RenderLine (_startPoint, endPoint, color, lineWidth, true); Vec2 smallVec = endPoint.Clone().Sub(_startPoint).Normalize ().Scale (-10); Vec2 left = new Vec2 (-smallVec.y, smallVec.x); Vec2 right = new Vec2 (smallVec.y, -smallVec.x); left.Add (smallVec).Add (endPoint); right.Add (smallVec).Add (endPoint); LineSegment.RenderLine (endPoint, left, color, lineWidth, true); LineSegment.RenderLine (endPoint, right, color, lineWidth, true); }