public Slides(string currentSceneName) { this.currentSceneName = currentSceneName; this.slides = new List<Slide>(); // ------------------------- Build no background ------------------------ \\ // Create Go Back to Menu Button GUIButton goBack = new GUIButton (); goBack .SetText(GUIConst.goBack) .OnClick(FlowControl.GoToLessonScreen) .SetBox((new Box()) .SetMarginTop (0.0f) .SetMarginRight (0.0f) .SetMarginBottom (0.0f) .SetMarginLeft (0.0f)); GUIFactory factory = new GUIFactory (); // Create "Help" Button GUIButton helpButton = new GUIButton (); helpButton .SetText(GUIConst.helpButtonText) .OnClick(FlowControl.ShowHelpMenu) .SetBox((new Box()) .SetMarginTop (0.0f) .SetMarginRight (0.0f) .SetMarginBottom (0.0f) .SetMarginLeft (0.0f)); factory.CreateContainer() .SetBox ((new Box()) .SetMarginTop ("auto") .SetMarginLeft ("5px") .SetMarginBottom ("5px") .SetMarginRight ("auto") .SetHeight (0.08f) .SetWidth(0.4f)).Append (goBack); factory .CreateContainer () .SetBox ((new Box()) .SetMarginTop ("auto") .SetMarginLeft ("auto") .SetMarginBottom ("5px") .SetMarginRight ("5px") .SetHeight (0.08f) .SetWidth("32px")) .Append(helpButton); guiNoBackground = factory.Build(); // ------------------------------------------------------------------------ // // ------------------------- Build Regular GUI -------------------------- \\ // Create Go Back to Menu Button goBack = new GUIButton (); goBack .SetText(GUIConst.goBack) .OnClick(FlowControl.GoToLessonScreen) .SetBox((new Box()) .SetMarginTop (0.0f) .SetMarginRight (0.0f) .SetMarginBottom (0.0f) .SetMarginLeft (0.0f)); factory = new GUIFactory (); // Create "Help" Button helpButton = new GUIButton (); helpButton .SetText(GUIConst.helpButtonText) .OnClick(FlowControl.ShowHelpMenu) .SetBox((new Box()) .SetMarginTop (0.0f) .SetMarginRight (0.0f) .SetMarginBottom (0.0f) .SetMarginLeft (0.0f)); factory.CreateContainer() .SetBox ((new Box()) .SetMarginTop ("auto") .SetMarginLeft ("5px") .SetMarginBottom ("5px") .SetMarginRight ("auto") .SetHeight (0.08f) .SetWidth(0.4f)).Append (goBack); factory .CreateContainer () .SetBox ((new Box()) .SetMarginTop ("auto") .SetMarginLeft ("auto") .SetMarginBottom ("5px") .SetMarginRight ("5px") .SetHeight (0.08f) .SetWidth("32px")) .Append(helpButton); factory .Prepend(new GUIImage("splash-background")); // Build gui = factory.Build(); FlowControl.SetCurrentSlides(this); }
public Slides(string currentSceneName) { this.currentSceneName = currentSceneName; this.slides = new List <Slide>(); // ------------------------- Build no background ------------------------ \\ // Create Go Back to Menu Button GUIButton goBack = new GUIButton(); goBack .SetText(GUIConst.goBack) .OnClick(FlowControl.GoToLessonScreen) .SetBox((new Box()) .SetMarginTop(0.0f) .SetMarginRight(0.0f) .SetMarginBottom(0.0f) .SetMarginLeft(0.0f)); GUIFactory factory = new GUIFactory(); // Create "Help" Button GUIButton helpButton = new GUIButton(); helpButton .SetText(GUIConst.helpButtonText) .OnClick(FlowControl.ShowHelpMenu) .SetBox((new Box()) .SetMarginTop(0.0f) .SetMarginRight(0.0f) .SetMarginBottom(0.0f) .SetMarginLeft(0.0f)); factory.CreateContainer() .SetBox((new Box()) .SetMarginTop("auto") .SetMarginLeft("5px") .SetMarginBottom("5px") .SetMarginRight("auto") .SetHeight(0.08f) .SetWidth(0.4f)).Append(goBack); factory .CreateContainer() .SetBox((new Box()) .SetMarginTop("auto") .SetMarginLeft("auto") .SetMarginBottom("5px") .SetMarginRight("5px") .SetHeight(0.08f) .SetWidth("32px")) .Append(helpButton); guiNoBackground = factory.Build(); // ------------------------------------------------------------------------ // // ------------------------- Build Regular GUI -------------------------- \\ // Create Go Back to Menu Button goBack = new GUIButton(); goBack .SetText(GUIConst.goBack) .OnClick(FlowControl.GoToLessonScreen) .SetBox((new Box()) .SetMarginTop(0.0f) .SetMarginRight(0.0f) .SetMarginBottom(0.0f) .SetMarginLeft(0.0f)); factory = new GUIFactory(); // Create "Help" Button helpButton = new GUIButton(); helpButton .SetText(GUIConst.helpButtonText) .OnClick(FlowControl.ShowHelpMenu) .SetBox((new Box()) .SetMarginTop(0.0f) .SetMarginRight(0.0f) .SetMarginBottom(0.0f) .SetMarginLeft(0.0f)); factory.CreateContainer() .SetBox((new Box()) .SetMarginTop("auto") .SetMarginLeft("5px") .SetMarginBottom("5px") .SetMarginRight("auto") .SetHeight(0.08f) .SetWidth(0.4f)).Append(goBack); factory .CreateContainer() .SetBox((new Box()) .SetMarginTop("auto") .SetMarginLeft("auto") .SetMarginBottom("5px") .SetMarginRight("5px") .SetHeight(0.08f) .SetWidth("32px")) .Append(helpButton); factory .Prepend(new GUIImage("splash-background")); // Build gui = factory.Build(); FlowControl.SetCurrentSlides(this); }