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()) { //back button 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 }
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_screen4.window.rec_bkg.openedRec, Input.cursorPos.X, Input.cursorPos.Y)) { Close(ExitAction.Example1); } //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()); } } #endregion }