/// <summary> /// Create User Interface (icon) for each selected entity (Building /// </summary> /// <param name="building"></param> /// <returns></returns> public SelectedEntityUI BuildSelectedEntityUI(Building building) { SelectedEntityUI seui = new SelectedEntityUI(game, building); seui.DrawBox = new Rectangle(0, 0, 75, 75); // Add the HP Bar to the UI. HPBar hpBar = new HPBar(game); hpBar.MaxHP = building.MaxHealth; hpBar.CurrentHP = building.CurrentHealth; hpBar.DrawBox = new Rectangle(5, 67, 65, 5); PictureBox pictureBox = BuildPictureBox("selectionAvatar", building.Type); pictureBox.DrawBox = new Rectangle(7, 3, 61, 61); seui.AddChild(pictureBox); seui.AddChild(hpBar); return(seui); }
/// <summary> /// Create User Interface (icon) for each selected entity (Building /// </summary> /// <param name="building"></param> /// <returns></returns> public SelectedEntityUI BuildSelectedEntityUI(Building building) { SelectedEntityUI seui = new SelectedEntityUI(game, building); seui.DrawBox = new Rectangle(0, 0, 75, 75); // Add the HP Bar to the UI. HPBar hpBar = new HPBar(game); hpBar.MaxHP = building.MaxHealth; hpBar.CurrentHP = building.CurrentHealth; hpBar.DrawBox = new Rectangle(5, 67, 65, 5); PictureBox pictureBox = BuildPictureBox("selectionAvatar", building.Type); pictureBox.DrawBox = new Rectangle(7, 3, 61, 61); seui.AddChild(pictureBox); seui.AddChild(hpBar); return seui; }