/// <summary> /// Constructs a new instance of the <see cref="GUIContainer"/> class. /// Anything that implements this must have an empty constructor, which refererences the empty base constructor. /// </summary> /// <param name="image">The texture of this GUI container.</param> /// <param name="drawingBounds">The bounds for which to draw the texture on the screen at.</param> /// <param name="priority">Determines if this GUI container should have priority over other GUI elements when sorting through input.</param> public GUIContainer(string image, Rectangle drawingBounds) { this.Image = AssetManager.Textures[AssetManager.GetTextureIndex(image)]; this.DrawingBounds = drawingBounds; this.Controls = new List <GUIElement>(); this.Priority = RenderingData.GetGUIContainerPriority(); }
/// <summary> /// Constructs a new instance of the <see cref="GUIContainer"/> class. /// Anything that implements this must have an empty constructor, which references the empty base constructor. /// </summary> /// <param name="image">The texture of this GUI container.</param> /// <param name="drawingBounds">The bounds for which to draw the texture on the screen at.</param> /// <param name="priority">Determines if this GUI container should have priority over other GUI elements when sorting through input.</param> /// <param name="isMovable">If true, then this GUI is movable.</param> protected GUIContainer(string image, Rectangle drawingBounds, bool isMovable) { this.Image = AssetManager.Textures[AssetManager.GetTextureIndex(image)]; this.DrawingBounds = drawingBounds; this.Controls = new List <GUIElement>(); this.Priority = RenderingData.GetGUIContainerPriority(); this.IsMovable = isMovable; }
/// <summary> /// Sets that container as the visible container, and gives it priority. /// </summary> /// <param name="container"></param> public static void Popup(GUIContainer container) { if (GUIWindows.Contains(container)) { MenuHandler.Clear(); container.Visible = true; container.Priority = RenderingData.GetGUIContainerPriority(); GUIWindows.Remove(container); GUIWindows.Add(container); } else { MenuHandler.Clear(); container.Visible = true; container.Priority = RenderingData.GetGUIContainerPriority(); GUIWindows.Add(container); } }