public static void ShowLine(Vector3 point1, Vector3 point2, Color color) { var visLine = ShapeManager.AddLine(); visLine.SetFromAbsoluteEndpoints(point1, point2); visLine.Color = color; //visLine.Visible = true; }
public static void ShowLine(SimpleLine line, Color color) { var visLine = ShapeManager.AddLine(); visLine.SetFromAbsoluteEndpoints(new Point3D(line.Start.X, line.Start.Y), new Point3D(line.End.X, line.End.Y)); visLine.Color = color; //visLine.Visible = true; }
public SpriteFrameIndividualSpriteOutline() { for (int i = 0; i < 2; i++) { mVerticalLines[i] = ShapeManager.AddLine(); mHorizontalLines[i] = ShapeManager.AddLine(); } }
private void _Debug_ShowLine(SimpleLine line, Color color) { var visLine = ShapeManager.AddLine(); visLine.SetFromAbsoluteEndpoints(new Point3D(line.Start.X, line.Start.Y), new Point3D(line.End.X, line.End.Y)); visLine.Color = color; visLine.Visible = true; visLine.Z = 10f; }
public SplinePointSelectionMarker() { mRectangle = ShapeManager.AddAxisAlignedRectangle(); mLine = ShapeManager.AddLine(); mRectangle.Color = Color.LightBlue; mEndpoint1 = ShapeManager.AddCircle(); mEndpoint1.Color = Color.Yellow; mEndpoint2 = ShapeManager.AddCircle(); mEndpoint2.Color = Color.Yellow; }
public WorldAxesDisplay() { mXAxis = ShapeManager.AddLine(); mXAxis.RelativePoint1 = new Point3D(0, 1000000); mXAxis.RelativePoint2 = new Point3D(0, -1000000); mYAxis = ShapeManager.AddLine(); mYAxis.RelativePoint1 = new Point3D(1000000, 0); mYAxis.RelativePoint2 = new Point3D(-1000000, 0); #if FRB_XNA mXAxis.Color = new Color(40, 40, 40, 255); mYAxis.Color = new Color(40, 40, 40, 255); #else mXAxis.Color = Color.FromArgb(255, 40, 40, 40); mYAxis.Color = Color.FromArgb(255, 40, 40, 40); #endif }
public Crosshair() { mCrossHair = new Line[2]; mCrossHair[0] = ShapeManager.AddLine(); mCrossHair[1] = ShapeManager.AddLine(); mCrossHair[1].RotationZ = (float)Math.PI / 2.0f; mCrossHair[0].ScaleBy(0.25F); mCrossHair[1].ScaleBy(0.25F); mCrossHair[0].AttachTo(this, true); mCrossHair[1].AttachTo(this, true); SpriteManager.AddPositionedObject(this); mColor = Color.White; mCrossHair[0].Color = mColor; mCrossHair[1].Color = mColor; }
private void RefreshOrigin() { if (showOrigin && originX == null) { originX = ShapeManager.AddLine(); originX.SetFromAbsoluteEndpoints( new Vector3(10000, 0, 0), new Vector3(-10000, 0, 0)); originY = ShapeManager.AddLine(); originY.SetFromAbsoluteEndpoints( new Vector3(0, 10000, 0), new Vector3(0, -10000, 0)); } if (originX != null) { originX.Visible = ShowOrigin; originY.Visible = ShowOrigin; } }
public void UpdateLineFromBobberCast(Vector3 bobberPosition, bool isFinalUpdate = false) { optimalTime = (DirectionCast == Direction.Down ? 0.1 : 0.06); DestinationVector = bobberPosition; var currentTime = FlatRedBall.TimeManager.CurrentTime; var lastLine = FishingLineLinesList.Last; if (lastLine == null || (currentTime - lastLineTime >= optimalTime)) { var newLine = ShapeManager.AddLine(); newLine.Color = new Color(LineColorRed, LineColorGreen, LineColorBlue, LineColorAlpha); if (lastLine == null) { newLine.SetFromAbsoluteEndpoints(OriginationVector, DestinationVector); } else { newLine.SetFromAbsoluteEndpoints(lastLine.AbsolutePoint2, new Point3D(DestinationVector)); } FishingLineLinesList.Add(newLine); lastLineTime = currentTime; } else { lastLine.SetFromAbsoluteEndpoints(lastLine.AbsolutePoint1, new Point3D(bobberPosition)); } if (isFinalUpdate) { lineIsSettling = true; if (DirectionCast == Direction.Left || DirectionCast == Direction.Right) { SettleHorizontalFishingLine(); } else { SettleVerticalFishingLine(); } } }
public HierarchyNode(VisibleRepresentationType visibleRepresentationType) { SpriteManager.AddPositionedObject(this); if (visibleRepresentationType == VisibleRepresentationType.Circle) { mCircleVisibleRepresentation = ShapeManager.AddCircle(); } else { mSpriteVisibleRepresentation = SpriteManager.AddSprite((Texture2D)null); #if FRB_MDX mSpriteVisibleRepresentation.ColorOperation = Microsoft.DirectX.Direct3D.TextureOperation.SelectArg2; #else mSpriteVisibleRepresentation.ColorOperation = ColorOperation.Color; #endif mSpriteVisibleRepresentation.Red = 1; mSpriteVisibleRepresentation.Green = 1; mSpriteVisibleRepresentation.Blue = 1; } mParentLine = ShapeManager.AddLine(); mParentLine.Visible = false; mParentAttachmentPoint = ShapeManager.AddCircle(); mParentAttachmentPoint.Visible = false; mParentAttachmentPoint.Radius = .2f; mText = TextManager.AddText(""); mText.Blue = 1; mText.Green = 1; mText.Red = 0; mText.HorizontalAlignment = HorizontalAlignment.Center; }
private void _FindAndShowPath() { // -- Find path List <FRBNavMesh.PortalNode> nodePath; var pointsPath = _NavMesh.FindPath(_StartPos, _GoalPos, out nodePath); // -- Debug visuals // NavPolys foreach (var navArea in _NavMesh.NavAreas) { navArea.Polygon.Color = Color.Salmon; } if (nodePath != null) { foreach (var node in nodePath) { node.ParentNavArea1.Polygon.Color = Color.SkyBlue; node.ParentNavArea2.Polygon.Color = Color.SkyBlue; } } // - Node Path Lines int nodePathLinesCount; Line nodePathLine; int i = 0; if (nodePath == null) // no path found { nodePathLinesCount = 0; } else { nodePathLinesCount = nodePath.Count - 1; // Add Lines int linesMissing = nodePathLinesCount - _NodesPathLines.Count; while (linesMissing > 0) { nodePathLine = ShapeManager.AddLine(); nodePathLine.Color = Dbg.NiceBlue; //Debug.Gray96; _NodesPathLines.Add(nodePathLine); linesMissing--; } // Update Lines for (; i < nodePathLinesCount; i++) { nodePathLine = _NodesPathLines[i]; nodePathLine.SetFromAbsoluteEndpoints( new Point3D(nodePath[i].X, nodePath[i].Y), new Point3D(nodePath[i + 1].X, nodePath[i + 1].Y) ); nodePathLine.Visible = true; } } // Hide remaining Lines for (; i < _NodesPathLines.Count; i++) { _NodesPathLines[i].Visible = false; } // - Final Path Lines int pathLinesCount; Line line; int j = 0; if (pointsPath == null) // no path found { pathLinesCount = 0; } else { pathLinesCount = pointsPath.Count - 1; // Add Lines int linesMissing = pathLinesCount - _FinalPathLines.Count; while (linesMissing > 0) { _FinalPathLines.Add(ShapeManager.AddLine()); linesMissing--; } // Update Lines for (; j < pathLinesCount; j++) { line = _FinalPathLines[j]; line.SetFromAbsoluteEndpoints( new Point3D(pointsPath[j].X, pointsPath[j].Y), new Point3D(pointsPath[j + 1].X, pointsPath[j + 1].Y) ); line.Visible = true; } } // Hide remaining Lines for (; j < _FinalPathLines.Count; j++) { _FinalPathLines[j].Visible = false; } }