static public void DrawStrippedLine(List <Vector2D> pointsList, float minVertexDistance, float z = 0f, bool full = false, Vector2D offset = null) { if (offset == null) { offset = new Vector2D(0, 0); } Vector2D vA = null, vB = null; if (Max2D.setBorder == true) { Color tmcColor = Max2D.setColor; float tmpWidth = Max2D.lineWidth; GL.PushMatrix(); Max2D.SetColor(Color.black); Max2D.lineMaterial.SetPass(0); GL.Begin(GL.QUADS); Max2D.lineWidth = 2f * tmpWidth; foreach (Pair2D id in Pair2D.GetList(pointsList, full)) { vA = new Vector2D(id.A + offset); vB = new Vector2D(id.B + offset); vA.Push(Vector2D.Atan2(id.A, id.B), -minVertexDistance / 5 * Max2D.setScale); vB.Push(Vector2D.Atan2(id.A, id.B), minVertexDistance / 5 * Max2D.setScale); Max2DMatrixLegacy.DrawLineImage(new Pair2D(vA, vB), z); } GL.End(); GL.PopMatrix(); Max2D.SetColor(tmcColor); Max2D.lineWidth = tmpWidth; } GL.PushMatrix(); Max2D.lineMaterial.SetPass(0); GL.Begin(GL.QUADS); foreach (Pair2D id in Pair2D.GetList(pointsList, full)) { vA = new Vector2D(id.A + offset); vB = new Vector2D(id.B + offset); vA.Push(Vector2D.Atan2(id.A, id.B), -minVertexDistance / 4 * Max2D.setScale); vB.Push(Vector2D.Atan2(id.A, id.B), minVertexDistance / 4 * Max2D.setScale); Max2DMatrixLegacy.DrawLineImage(new Pair2D(vA, vB), z); } GL.End(); GL.PopMatrix(); }
static public void DrawSmoothLine(Pair2D pair, float z = 0f) { GL.PushMatrix(); Max2D.lineMaterial.SetPass(0); GL.Begin(GL.QUADS); Max2DMatrixLegacy.DrawLineImage(pair, z); GL.End(); GL.PopMatrix(); }
static public void DrawLineRectf(float x, float y, float w, float h, float z = 0f) { if (Max2D.lineMode == Max2D.LineMode.Smooth) { GL.PushMatrix(); Max2D.lineMaterial.SetPass(0); GL.Begin(GL.QUADS); if (Max2D.setBorder == true) { Color tmcColor = Max2D.setColor; float tmpWidth = Max2D.lineWidth; Max2D.SetColor(Color.black); Max2D.lineWidth = tmpWidth * 2f; Max2DMatrixLegacy.DrawLineImage(new Pair2D(new Vector2D(x, y), new Vector2D(x + w, y)), z); Max2DMatrixLegacy.DrawLineImage(new Pair2D(new Vector2D(x, y), new Vector2D(x, y + h)), z); Max2DMatrixLegacy.DrawLineImage(new Pair2D(new Vector2D(x + w, y), new Vector2D(x + w, y + h)), z); Max2DMatrixLegacy.DrawLineImage(new Pair2D(new Vector2D(x, y + h), new Vector2D(x + w, y + h)), z); Max2D.SetColor(tmcColor); Max2D.lineWidth = tmpWidth; } float tmpLine = Max2D.lineWidth; Max2D.lineWidth = tmpLine * 1f; Max2D.SetColor(Max2D.setColor); Max2DMatrixLegacy.DrawLineImage(new Pair2D(new Vector2D(x, y), new Vector2D(x + w, y)), z); Max2DMatrixLegacy.DrawLineImage(new Pair2D(new Vector2D(x, y), new Vector2D(x, y + h)), z); Max2DMatrixLegacy.DrawLineImage(new Pair2D(new Vector2D(x + w, y), new Vector2D(x + w, y + h)), z); Max2DMatrixLegacy.DrawLineImage(new Pair2D(new Vector2D(x, y + h), new Vector2D(x + w, y + h)), z); GL.End(); GL.PopMatrix(); Max2D.lineWidth = tmpLine; } else { DrawLine(new Vector2D(x, y), new Vector2D(x + w, y), z); DrawLine(new Vector2D(x + w, y), new Vector2D(x + w, y + h), z); DrawLine(new Vector2D(x + w, y + h), new Vector2D(x, y + h), z); DrawLine(new Vector2D(x, y + h), new Vector2D(x, y), z); } }