public void DrawUI(SpriteBatch Target, Camera cam) { if (Visible) { UI_UnitInfo.Position = new Vector2(CoordsConvert.WorldToWindowCoords(Position, cam).X + (FrameSize.X * cam.Zoom - UI_UnitInfo.Texture.Width) / 2, CoordsConvert.WorldToWindowCoords(Position + FrameSize, cam).Y); UI_UnitInfo.Draw(Target); } }
public void CreatePathArrows(List <Point> Path, Camera cam) { PathFindingArrows = new List <Arrow>(); if (Path != null) { PathFindingArrows = new List <Arrow>(); for (var i = 0; i < Path.Count - 1; i++) { var tmpVectStart = CoordsConvert.WorldToWindowCoords(GetTileCenterByIJ(Path[i].X, Path[i].Y), cam); var tmpVectStop = CoordsConvert.WorldToWindowCoords(GetTileCenterByIJ(Path[i + 1].X, Path[i + 1].Y), cam); PathFindingArrows.Add(new Arrow(tmpVectStart, tmpVectStop, ArrowSegment, ArrowEndSegment, 0.4f + i * 0.001f)); PathFindingArrows.Last().Scale = 0.5f; } } }
static public Vector2 MouseToWorldCoords(Camera camera) { return(CoordsConvert.WindowToWorldCoords(new Vector2(X, Y), camera)); }