コード例 #1
0
        public override void Update()
        {
            //update all ui items
            for (i = 0; i < aui_instances.Count; i++)
            {
                aui_instances[i].Update();
            }

            #region Screen Display States

            if (displayState == DisplayState.Opening)
            {
                if (button_back.displayState == DisplayState.Opened)
                {
                    displayState = DisplayState.Opened;
                }
            }
            else if (displayState == DisplayState.Opened)
            {
                //handle main input here
                if (Input.IsLeftMouseBtnPress())
                {
                    //dump the list count for debugging
                    Debug.WriteLine(
                        "aui instances: " +
                        aui_instances.Count);
                    //this allows verification of baby removal

                    if (Functions.Contains(
                            button_back.window.rec_bkg.openedRec,
                            Input.cursorPos.X, Input.cursorPos.Y))
                    {
                        Close(ExitAction.Title);
                    }
                }
            }
            else if (displayState == DisplayState.Closing)
            {
                //ensure all aui items are closed
                Boolean allClosed = true; //assume true, prove false
                for (i = 0; i < aui_instances.Count; i++)
                {
                    if (aui_instances[i].displayState != DisplayState.Closed)
                    {
                        allClosed = false;
                    }
                }
                if (allClosed)
                {
                    displayState = DisplayState.Closed;
                }
            }
            else if (displayState == DisplayState.Closed)
            {
                if (exitAction == ExitAction.Title)
                {
                }
                //this screen only closes one way
                ScreenManager.ExitAndLoad(new Screen_Title());
            }

            #endregion
        }
コード例 #2
0
ファイル: Screen_TItle.cs プロジェクト: jianglu/AUI
        public override void Update()
        {
            //update all ui items
            for (i = 0; i < aui_instances.Count; i++)
            {
                aui_instances[i].Update();
            }

            #region Screen Display States

            if (displayState == DisplayState.Opening)
            {
                if (button_screen1.displayState == DisplayState.Opened)
                {
                    displayState = DisplayState.Opened;
                }
            }
            else if (displayState == DisplayState.Opened)
            {
                //handle main input here
                if (Input.IsLeftMouseBtnPress())
                {
                    //button 1
                    if (Functions.Contains(
                            button_screen1.window.rec_bkg.openedRec,
                            Input.cursorPos.X, Input.cursorPos.Y))
                    {
                        Close(ExitAction.Example1);
                    }
                    //button 2
                    if (Functions.Contains(
                            button_screen2.window.rec_bkg.openedRec,
                            Input.cursorPos.X, Input.cursorPos.Y))
                    {
                        Close(ExitAction.StressTest);
                    }
                    //button 3
                    if (Functions.Contains(
                            button_screen3.window.rec_bkg.openedRec,
                            Input.cursorPos.X, Input.cursorPos.Y))
                    {
                        Close(ExitAction.Spider);
                    }
                    //button 4
                    if (Functions.Contains(
                            button_radial.window.rec_bkg.openedRec,
                            Input.cursorPos.X, Input.cursorPos.Y))
                    {
                        Close(ExitAction.RadialMenu);
                    }
                    //button 5
                    if (Functions.Contains(
                            button_screen5.window.rec_bkg.openedRec,
                            Input.cursorPos.X, Input.cursorPos.Y))
                    {
                        Close(ExitAction.Example1);
                    }
                }
            }
            else if (displayState == DisplayState.Closing)
            {
                //ensure all aui items are closed
                Boolean allClosed = true; //assume true, prove false
                for (i = 0; i < aui_instances.Count; i++)
                {
                    if (aui_instances[i].displayState != DisplayState.Closed)
                    {
                        allClosed = false;
                    }
                }
                if (allClosed)
                {
                    displayState = DisplayState.Closed;
                }
            }
            else if (displayState == DisplayState.Closed)
            {
                if (exitAction == ExitAction.Title)
                {
                    ScreenManager.ExitAndLoad(new Screen_Title());
                }
                else if (exitAction == ExitAction.Example1)
                {
                    ScreenManager.ExitAndLoad(new Screen_Example1());
                }
                else if (exitAction == ExitAction.StressTest)
                {
                    ScreenManager.ExitAndLoad(new Screen_StressTest());
                }
                else if (exitAction == ExitAction.Spider)
                {
                    ScreenManager.ExitAndLoad(new Screen_Spider());
                }
                else if (exitAction == ExitAction.RadialMenu)
                {
                    ScreenManager.ExitAndLoad(new Screen_Radial());
                }
            }

            #endregion
        }