Beispiel #1
0
        /// <summary>
        /// Adds a control and returns its index. Intended for when inheriting classes
        /// are constructing, so they can set a default selected item
        ///
        /// TODO: update this control to manage placing menu controls
        /// </summary>
        /// <param name="control"></param>
        /// <returns></returns>
        protected int AddControl(MenuControl control)
        {
            Controls.Add(control);

            //since vector2 is a struct, a new Vector2 must be assigned
            //rather than simply updating its value
            control.Position = new Vector2(controlMargin, CalculateVerticalPosition(Controls.Count - 1, control.Height));

            return(Controls.Count - 1);
        }
Beispiel #2
0
        /// <summary>
        /// Adds a control and returns its index. Intended for when inheriting classes
        /// are constructing, so they can set a default selected item
        /// 
        /// TODO: update this control to manage placing menu controls
        /// </summary>
        /// <param name="control"></param>
        /// <returns></returns>
        protected int AddControl(MenuControl control)
        {
            Controls.Add(control);

            //since vector2 is a struct, a new Vector2 must be assigned
            //rather than simply updating its value
            control.Position = new Vector2(controlMargin, CalculateVerticalPosition(Controls.Count - 1, control.Height));

            return Controls.Count - 1;
        }
Beispiel #3
0
 /// <summary>
 /// Adds a control and returns its index. Intended for when inheriting classes
 /// are constructing, so they can set a default selected item
 /// </summary>
 /// <param name="control"></param>
 /// <returns></returns>
 protected int AddControl(MenuControl control)
 {
     Controls.Add(control);
     return Controls.Count - 1;
 }