Example #1
0
        public void clearMenu()
        {
            // Start clearMenu.

            // Basic required information to make a template:
            _name = null;
            _menuSize = Vector2.Zero;
            _position = Vector2.Zero;
            _targetScreen = MenuDefines.ScreenMaxTarget.NOT_SET;

            // Extended information:
            _backgroundColor = MenuDefines.defaultMenuColor;
            _backgroundImage = null;
            _backgroundTransparancy = MenuDefines.defaultMenuTransparancy;
            _backgroundSize = Vector2.Zero;

            // Transit In Effects:
            _transitInEffectType = MenuDefines.EffectsList.None;
            _transitInEffect = null;

            // Transit Out Effects:
            _transitOutEffectType = MenuDefines.EffectsList.None;
            _transitOutEffect = null;

            // Widget List:
            widgetList = null;

            // Fields required for drawing:
            _backgroundTint = _backgroundColor;
            _backgroundOrigin = MenuDefines.defaultMenuOrigin;
            _backgroundRotation = MenuDefines.defaultMenuRotation;
            _backgroundDestanationRectangle = new Rectangle( 0, 0, 0, 0 );
            _backgroundLayer = MenuDefines.defaultMenuLayer;

            #region Delegate Lists
            // Delegate Objects:

            //Update Widget Delegates:
            updateWidgetList = null;

            //Update Position Delegates:
            updatePositionList = null;

            //Draw delegates:
            drawWidgetList = null;

            #endregion

            //List and misc variables:
            i = 0;
            listCount = 0;
            listCount2 = 0;
            tempScreenSize = Vector2.Zero;
        }
Example #2
0
        public void addWidget( WidgetBase widget )
        {
            // Start addWidget.

            if ( widget != null )
            { // Start if the widget is null

                widgetList.Add( widget );
                listCount2 = ( widgetList.Count - 1 ); // Grabbing the position index of the new widget.
                widgetList[ listCount2 ].actavate();

                // If the widget is updateable we add it to the update list:
                if ( widget is IUpdate )
                {
                    updateWidgetList += (((IUpdate )( widget )).update );
                }

                // If the widget is drawable we add it to the draw list:
                if (widget is IDraw)
                {
                    drawWidgetList += (((IDraw)(widget)).draw );
                }

                // Adding the widget to the updatePositionList and then updating the position:
                updatePositionList += widget.updatePosition;
                widgetList[ listCount2 ].updatePosition( ( _position + _backgroundPositionCorection), _backgroundSize );
                //Func<
                //Action<

            } // End if the widget is null
        }