static FlowControl() { // Draw Panel // Draw buttons: // Create "Start a Lesson" Button GUIButton startALessonButton = new GUIButton(); startALessonButton .SetText("Pick A Lesson") .OnClick(FlowControl.GoToLessonScreen) .SetBox((new Box()) .SetMarginTop (0.0f) .SetMarginRight (0.0f) .SetMarginBottom (0.80f) .SetMarginLeft (0.0f)); // Create "Visit Mantaray AR Website" Button GUIButton getARTargets = new GUIButton(); getARTargets .SetText(GUIConst.getARTargets) .OnClick(FlowControl.GetTargets) .SetBox((new Box()) .SetMarginTop (0.25f) .SetMarginRight (0.0f) .SetMarginBottom (0.55f) .SetMarginLeft (0.0f)); // Create "Visit Mantaray AR Website" Button GUIButton visitMantarayARWebsiteButton = new GUIButton(); visitMantarayARWebsiteButton .SetText(GUIConst.visitMantarayARWebsiteText) .OnClick(FlowControl.GoToWebsite) .SetBox((new Box()) .SetMarginTop (0.50f) .SetMarginRight (0.0f) .SetMarginBottom (0.30f) .SetMarginLeft (0.0f)); // Create "Return" Button GUIButton exitMenuButton = new GUIButton(); exitMenuButton .SetText("Go Back") .OnClick(FlowControl.ExitMenu) .SetBox((new Box()) .SetMarginTop (0.75f) .SetMarginRight (0.0f) .SetMarginBottom (0.05f) .SetMarginLeft (0.0f)); // Build the GUI GUIFactory factory = new GUIFactory (); factory .Append(new GUIImage("dark-transparent-swatch").SetScaleMode(ScaleMode.StretchToFill)); factory .CreateContainer () .SetBox ((new Box ()) .SetMarginTop (0.2f) .SetMarginRight (0.2f) .SetMarginBottom (0.2f) .SetMarginLeft (0.2f)) .Append (startALessonButton) .Append (getARTargets) .Append (visitMantarayARWebsiteButton) .Append (exitMenuButton); FlowControl.gui = factory.Build(); }
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); }
// Use this for initialization void Start() { // Create a list of lessons List<Lesson> lessons = CustomLessons.GetInstance().GetLessons(); // Create Go Back to Menu Button GUIButton goBack = new GUIButton (); goBack .SetText("Go Back to Main Menu") .OnClick(FlowControl.ShowMainMenu) .SetBox((new Box()) .SetMarginTop (0.0f) .SetMarginRight (0.0f) .SetMarginBottom (0.0f) .SetMarginLeft (0.0f)); // 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)); GUIFactory factory = new GUIFactory (); factory .Append(new GUIImage("splash-background")); // Attach them to a "Lesson Scroll Area" factory .CreateScrollArea () .SetBox((new Box()) .SetMarginBottom(0.1f) .SetMarginTop(0.1f) .SetMarginLeft(0.1f) .SetMarginRight(0.1f)) .Append(new GUILessonList(lessons)); 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); // Build gui = factory.Build(); }
static FlowControl() { // Draw Panel // Draw buttons: // Create "Start a Lesson" Button GUIButton startALessonButton = new GUIButton(); startALessonButton .SetText("Pick A Lesson") .OnClick(FlowControl.GoToLessonScreen) .SetBox((new Box()) .SetMarginTop(0.0f) .SetMarginRight(0.0f) .SetMarginBottom(0.80f) .SetMarginLeft(0.0f)); // Create "Visit Mantaray AR Website" Button GUIButton getARTargets = new GUIButton(); getARTargets .SetText(GUIConst.getARTargets) .OnClick(FlowControl.GetTargets) .SetBox((new Box()) .SetMarginTop(0.25f) .SetMarginRight(0.0f) .SetMarginBottom(0.55f) .SetMarginLeft(0.0f)); // Create "Visit Mantaray AR Website" Button GUIButton visitMantarayARWebsiteButton = new GUIButton(); visitMantarayARWebsiteButton .SetText(GUIConst.visitMantarayARWebsiteText) .OnClick(FlowControl.GoToWebsite) .SetBox((new Box()) .SetMarginTop(0.50f) .SetMarginRight(0.0f) .SetMarginBottom(0.30f) .SetMarginLeft(0.0f)); // Create "Return" Button GUIButton exitMenuButton = new GUIButton(); exitMenuButton .SetText("Go Back") .OnClick(FlowControl.ExitMenu) .SetBox((new Box()) .SetMarginTop(0.75f) .SetMarginRight(0.0f) .SetMarginBottom(0.05f) .SetMarginLeft(0.0f)); // Build the GUI GUIFactory factory = new GUIFactory(); factory .Append(new GUIImage("dark-transparent-swatch").SetScaleMode(ScaleMode.StretchToFill)); factory .CreateContainer() .SetBox((new Box()) .SetMarginTop(0.2f) .SetMarginRight(0.2f) .SetMarginBottom(0.2f) .SetMarginLeft(0.2f)) .Append(startALessonButton) .Append(getARTargets) .Append(visitMantarayARWebsiteButton) .Append(exitMenuButton); FlowControl.gui = factory.Build(); }
// Use this for initialization void Start() { // Bootstrap Assets Assets.GetInstance(); // Create "Start a Lesson" Button GUIButton startALessonButton = new GUIButton(); startALessonButton .SetText(GUIConst.startALessonText) .OnClick(FlowControl.GoToLessonScreen) .SetBox((new Box()) .SetMarginTop(0.0f) .SetMarginRight(0.0f) .SetMarginBottom(0.70f) .SetMarginLeft(0.0f)); // Create "Visit Mantaray AR Website" Button GUIButton getARTargets = new GUIButton(); getARTargets .SetText(GUIConst.getARTargets) .OnClick(FlowControl.GetTargets) .SetBox((new Box()) .SetMarginTop(0.35f) .SetMarginRight(0.0f) .SetMarginBottom(0.35f) .SetMarginLeft(0.0f)); // Create "Visit Mantaray AR Website" Button GUIButton visitMantarayARWebsiteButton = new GUIButton(); visitMantarayARWebsiteButton .SetText(GUIConst.visitMantarayARWebsiteText) .OnClick(FlowControl.GoToWebsite) .SetBox((new Box()) .SetMarginTop(0.70f) .SetMarginRight(0.0f) .SetMarginBottom(0.0f) .SetMarginLeft(0.0f)); // 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)); // Build the GUI GUIFactory factory = new GUIFactory(); factory .Append(new GUIImage("splash-background")); ((GUILabel)factory .CreateLabel()) .SetStyle(new GUIStyle()) .SetBox((new Box()) .SetMarginTop(0.1f) .SetMarginRight(0.05f) .SetMarginBottom("auto") .SetMarginLeft(0.05f) .SetHeight(0.45f)) .Append((new GUIImage("splash-logo")).SetScaleMode(ScaleMode.ScaleToFit)); factory .CreateContainer() .SetBox((new Box()) .SetMarginTop("auto") .SetMarginRight(0.2f) .SetMarginBottom(0.1f) .SetMarginLeft(0.2f) .SetHeight(0.4f)) .Append(startALessonButton) .Append(getARTargets) .Append(visitMantarayARWebsiteButton); factory .CreateContainer() .SetBox((new Box()) .SetMarginTop("auto") .SetMarginLeft("auto") .SetMarginBottom("5px") .SetMarginRight("5px") .SetHeight(0.08f) .SetWidth("32px")) .Append(helpButton); gui = factory.Build(); }
// Use this for initialization void Start() { // Create a list of lessons List <Lesson> lessons = CustomLessons.GetInstance().GetLessons(); // Create Go Back to Menu Button GUIButton goBack = new GUIButton(); goBack .SetText("Go Back to Main Menu") .OnClick(FlowControl.ShowMainMenu) .SetBox((new Box()) .SetMarginTop(0.0f) .SetMarginRight(0.0f) .SetMarginBottom(0.0f) .SetMarginLeft(0.0f)); // 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)); GUIFactory factory = new GUIFactory(); factory .Append(new GUIImage("splash-background")); // Attach them to a "Lesson Scroll Area" factory .CreateScrollArea() .SetBox((new Box()) .SetMarginBottom(0.1f) .SetMarginTop(0.1f) .SetMarginLeft(0.1f) .SetMarginRight(0.1f)) .Append(new GUILessonList(lessons)); 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); // Build gui = factory.Build(); }
// Use this for initialization void Start() { // Bootstrap Assets Assets.GetInstance(); // Create "Start a Lesson" Button GUIButton startALessonButton = new GUIButton(); startALessonButton .SetText(GUIConst.startALessonText) .OnClick(FlowControl.GoToLessonScreen) .SetBox((new Box()) .SetMarginTop (0.0f) .SetMarginRight (0.0f) .SetMarginBottom (0.70f) .SetMarginLeft (0.0f)); // Create "Visit Mantaray AR Website" Button GUIButton getARTargets = new GUIButton(); getARTargets .SetText(GUIConst.getARTargets) .OnClick(FlowControl.GetTargets) .SetBox((new Box()) .SetMarginTop (0.35f) .SetMarginRight (0.0f) .SetMarginBottom (0.35f) .SetMarginLeft (0.0f)); // Create "Visit Mantaray AR Website" Button GUIButton visitMantarayARWebsiteButton = new GUIButton(); visitMantarayARWebsiteButton .SetText(GUIConst.visitMantarayARWebsiteText) .OnClick(FlowControl.GoToWebsite) .SetBox((new Box()) .SetMarginTop (0.70f) .SetMarginRight (0.0f) .SetMarginBottom (0.0f) .SetMarginLeft (0.0f)); // 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)); // Build the GUI GUIFactory factory = new GUIFactory (); factory .Append(new GUIImage("splash-background")); ((GUILabel)factory .CreateLabel ()) .SetStyle (new GUIStyle()) .SetBox ((new Box ()) .SetMarginTop (0.1f) .SetMarginRight (0.05f) .SetMarginBottom ("auto") .SetMarginLeft (0.05f) .SetHeight (0.45f)) .Append ((new GUIImage("splash-logo")).SetScaleMode(ScaleMode.ScaleToFit)); factory .CreateContainer () .SetBox ((new Box ()) .SetMarginTop ("auto") .SetMarginRight (0.2f) .SetMarginBottom (0.1f) .SetMarginLeft (0.2f) .SetHeight (0.4f)) .Append (startALessonButton) .Append (getARTargets) .Append (visitMantarayARWebsiteButton); factory .CreateContainer () .SetBox ((new Box()) .SetMarginTop ("auto") .SetMarginLeft ("auto") .SetMarginBottom ("5px") .SetMarginRight ("5px") .SetHeight (0.08f) .SetWidth("32px")) .Append(helpButton); gui = factory.Build(); }
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); }