private bool DrawHandle(PhysicalObject CurrObj, GraphicsDevice gdDevice, SpriteBatch dbDraw) { //Debug stuff to help with movement algorithm /* * if (cTarget != null) { * DrawTools.DrawLine(gdDevice, dbDraw, Color.Red, 2, CenterPoint, cTarget.CenterPoint); * } * * if (cAvoid != null) { * DrawTools.DrawLine(gdDevice, dbDraw, Color.Cyan, 2, CenterPoint, cAvoid.CenterPoint); * } */ Vector vHealthBar = new Vector(); Vector2 vHealthStart, vHealthEnd; vHealthBar.SetPolarCoordinates(50f * (cnHealth / 100f), 0); vHealthStart = CenterPoint + new Vector2(-25, 25); vHealthEnd = vHealthStart + new Vector2((float)vHealthBar.Rectangular.Real, (float)vHealthBar.Rectangular.Imaginary); DrawTools.DrawLine(gdDevice, dbDraw, Color.Red, 5, vHealthStart, vHealthEnd); return(true); }
public void DrawPointArray(int id, Color color) { Vector2 point, point2; DrawTools.LineColor = color; IEnumerator <PriceFluctuation> it = visibleFluctuations.GetEnumerator(); while (it.MoveNext() && (!it.Current.ExtraData.ContainsKey(id) || !(it.Current.ExtraData[id] is float))) { ; } if (!it.Current.ExtraData.ContainsKey(id)) { return; } point = cam.WorldToScreenPoint(new Vector2(CoordGrid.FromDateToXAxis(it.Current.PeriodBegin), CoordGrid.FromPriceToYAxis((float)it.Current.ExtraData[id]))); while (it.MoveNext()) { if (it.Current.ExtraData[id] is float) { point2 = cam.WorldToScreenPoint(new Vector2(CoordGrid.FromDateToXAxis(it.Current.PeriodBegin), CoordGrid.FromPriceToYAxis((float)it.Current.ExtraData[id]))); DrawTools.DrawLine(point, point2, false); point = point2; } } }