/// <summary> /// Triangles Example /// </summary> private void DrawTriangles() { mRectangleY += mRectangleHeight + 20; Drawing2D.DrawRect(new Rect(mRectangleX, mRectangleY, mRectangleWidth, mRectangleHeight)); Drawing2D.DrawText("Triangles", mRectangleX + 5, mRectangleY + 5, 18, Color.white, mBitmapFont); float x = 15 - mSampleWidth; float y = mRectangleY + 50; x += mSampleWidth + 50; Drawing2D.DrawTriangle(new Vector2(x, y), new Vector2(x + 30, y - 15), new Vector2(x + 15, y + 15), ToColor(36, 86, 188), 2f); x += mSampleWidth; Drawing2D.DrawTriangle(new Vector2(x - 10, y + 5), new Vector2(x + 60, y - 20), new Vector2(x + 15, y + 15), ToColor(93, 166, 221), 4f); x += mSampleWidth; Drawing2D.DrawTriangle(new Vector2(x + 5, y - 10), new Vector2(x + 40, y - 15), new Vector2(x + 15, y + 20), ToColor(21, 179, 89), 2f); x += mSampleWidth + 20; Drawing2D.DrawDashedTriangle(new Vector2(x - 20, y), new Vector2(x + 30, y - 5), new Vector2(x + 15, y + 15), ToColor(175, 217, 141), 2f, 3f); x += mSampleWidth; Drawing2D.DrawDashedTriangle(new Vector2(x - 10, y - 15), new Vector2(x + 60, y - 20), new Vector2(x + 15, y + 15), ToColor(248, 222, 104), 4f, 3); x += mSampleWidth; Drawing2D.DrawDashedTriangle(new Vector2(x - 35, y - 30), new Vector2(x + 60, y - 25), new Vector2(x + 15, y + 20), ToColor(255, 196, 126), 6f, 3); Drawing2D.FillTriangle(new Vector2(x += mSampleWidth, y - 20), new Vector2(x + 50, y), new Vector2(x + 30, y + 20), ToColor(255, 112, 92)); Drawing2D.FillTriangle(new Vector2(x += mSampleWidth, y), new Vector2(x + 90, y - 20), new Vector2(x + 20, y + 20), ToColor(232, 62, 83)); }
public void DrawTriangle(Vector2 a, Vector2 b, Vector2 c, Color color, float lineWidth) { Drawing2D.DrawTriangle(a, b, c, color, lineWidth); }