public void Draw(FPCanvas canvas) { canvas.SetCurrentColor(Color.FromArgb(100, Color.White)); FPElevator.ElevatorTexture.Draw(new PointF(X, Y), WidthSegments, 1); canvas.DisableTexturing(); RectangleF start = elevatorStart.Rect; RectangleF end = this.Rect; canvas.SetCurrentColor(Color.FromArgb(255, 0, 255, 0)); canvas.DrawLine(start.MiddlePoint(), end.MiddlePoint()); }
private void DrawHandlesOnGameObject(FPCanvas canvas, FPGameObject gameObject) { RectangleF rect = gameObject.Rect; canvas.DisableTexturing(); canvas.SetCurrentColor(Color.FromArgb(204, Color.White)); canvas.DrawRectangle(rect); canvas.SetPointSize(6.0f); var draggedObject = DraggedObject; bool widthHandles = false; bool heightHandles = false; if (draggedObject != null) { widthHandles = draggedObject.WidthSegments > 0; heightHandles = draggedObject.HeightSegments > 0; } for (FPDragHandle handle = FPDragHandle.TopLeft; handle < FPDragHandle.Center; handle++) { if (!widthHandles && IsWidthHandle(handle)) continue; if (!heightHandles && IsHeightHandle(handle)) continue; if (handle == currentHandle) canvas.SetCurrentColor(Color.FromArgb(204, Color.Red)); else canvas.SetCurrentColor(Color.FromArgb(204, Color.Yellow)); PointF handlePoint = PointFromHandleAroundRect(handle, rect); canvas.DrawPoint(handlePoint); } }