public override void DrawDragConstraint() { if (model.draggedVertex != null) { if (model.draggedBody == null) { Drawing2D.DrawLine(model.draggedVertex.position + DemoUtils.offset, model.dragPosition + DemoUtils.offset, DemoUtils.dragConstraintColor); } Drawing2D.DrawCircle(model.draggedVertex.position + DemoUtils.offset, DemoUtils.pinSize, 8, DemoUtils.dragConstraintColor); } }
/// <summary> /// Circles Example /// </summary> private void DrawCircles() { mRectangleY += mRectangleHeight + 20; Drawing2D.DrawRect(new Rect(mRectangleX, mRectangleY, mRectangleWidth, mRectangleHeight)); Drawing2D.DrawText("Circles", mRectangleX + 5, mRectangleY + 5, 18, Color.white, mBitmapFont); float x = 15 - mSampleWidth; float y = mRectangleY + 50; float radius = mRectangleHeight - 60; Drawing2D.DrawCircle(new Vector2((x += mSampleWidth) + ((mSampleWidth / 2) - radius), y), radius, 8, ToColor(36, 86, 188), 2f); Drawing2D.DrawCircle(new Vector2((x += mSampleWidth) + ((mSampleWidth / 2) - radius), y), radius, 20, ToColor(93, 166, 221), 2f); Drawing2D.DrawCircle(new Vector2((x += mSampleWidth) + ((mSampleWidth / 2) - radius), y), radius, 20, ToColor(21, 179, 89), 4f); radius = mRectangleHeight - 50; y = mRectangleY + 40; Drawing2D.DrawDashedCircle(new Vector2((x += mSampleWidth) + ((mSampleWidth / 2) - radius), y), radius, 12, ToColor(175, 217, 141), 3f, 3f); Drawing2D.DrawDashedCircle(new Vector2((x += mSampleWidth) + ((mSampleWidth / 2) - radius), y), radius, 12, ToColor(248, 222, 104), 3f, 3f); Drawing2D.DrawDashedCircle(new Vector2((x += mSampleWidth) + ((mSampleWidth / 2) - radius), y), radius, 12, ToColor(255, 196, 126), 3f, 3f); Drawing2D.FillCircle(new Vector2((x += mSampleWidth) + ((mSampleWidth / 2) - radius), y), radius, ToColor(255, 112, 92)); Drawing2D.FillCircle(new Vector2((x += mSampleWidth) + ((mSampleWidth / 2) - radius), y), radius * 1.15f, ToColor(232, 62, 83)); }
public void DrawCircle(Vector2 center, float radius, int sides, Color color, float lineWidth) { Drawing2D.DrawCircle(center, radius, sides, color, lineWidth); }