// --------------------------------------------------------------------- // --------------------------------------------------------------------- public override void Update() { for (int x = 0; x < m_ChildCount; ++x) { IUIBase currentChild = m_Children[x]; currentChild.Update(); } }
// --------------------------------------------------------------------- // --------------------------------------------------------------------- public override void Draw(SpriteBatch spriteBatch) { for (int x = 0; x < m_ChildCount; ++x) { IUIBase currentChild = m_Children[x]; currentChild.Draw(spriteBatch); } }
// --------------------------------------------------------------------- // --------------------------------------------------------------------- public void AddChild(IUIBase child) { child.SetPosition(m_EndingPosition); m_Children.Add(child); m_ChildCount++; if (m_Horizontal) { m_EndingPosition += new Vector2(child.GetWidth() + m_Padding, 0); } else { m_EndingPosition += new Vector2(0, child.GetHeight() + m_Padding); } }
// --------------------------------------------------------------------- // --------------------------------------------------------------------- private void UpdateChildPositions() { for (int x = 0; x < m_ChildCount; ++x) { IUIBase child = m_Children[x]; child.SetPosition(m_EndingPosition); if (m_Horizontal) { m_EndingPosition += new Vector2(child.GetWidth() + m_Padding, 0); } else { m_EndingPosition += new Vector2(0, child.GetHeight() + m_Padding); } } }