Inheritance: MonoBehaviour
Exemple #1
0
 public void TestMenu10()
 {
     MenuBox.Show
     (
         new[]
     {
         "Option 1",
         "Option 2",
         "Option 3",
         "Option 4",
         "Option 5",
         "Option 6",
         "Option 7",
         "Option 8",
         "Option 9",
         "Show an even bigger menu!"
     },
         new UnityAction[]
     {
         () => MessageBox.Show("You clicked on Option 1"),
         () => MessageBox.Show("You clicked on Option 2"),
         () => MessageBox.Show("You clicked on Option 3"),
         () => MessageBox.Show("You clicked on Option 4"),
         () => MessageBox.Show("You clicked on Option 5"),
         () => MessageBox.Show("You clicked on Option 6"),
         () => MessageBox.Show("You clicked on Option 7"),
         () => MessageBox.Show("You clicked on Option 8"),
         () => MessageBox.Show("You clicked on Option 9"),
         TestMenu15
     },
         "Ten Item Test Menu"
     );
 }
    public void dialog_setContent(Int32 talkerId, List <object> dialogIds, List <object> dialogsTitles, string title, string body, string sayname)
    {
        KBEngine.Entity entity = KBEngineApp.app.player();
        KBEngine.Avatar avatar = null;
        if (entity != null && entity.className == "Avatar")
        {
            avatar = (KBEngine.Avatar)entity;
        }

        List <string>      titles  = new List <string>();
        List <UnityAction> actions = new List <UnityAction>();

        for (int i = 0; i < dialogsTitles.Count; i++)
        {
            titles.Add((string)dialogsTitles[i]);
            UInt32 dialogId = (UInt32)dialogIds[i];
            actions.Add(() => avatar.dialog(talkerId, dialogId));
        }
        if (titles.Count > 0)
        {
            MenuBox.Show
            (
                titles,
                actions,
                sayname + ": " + body
            );
        }
    }
 void Update()
 {
     if (toggleVar == 1)
     {
         MenuBox.SetActive(true);
     }
     else
     {
         MenuBox.SetActive(false);
     }
 }
        public MainMenuLayer(SpriteFont menuFont)
        {
            this.menuFont = menuFont;
            var button1 = new Button(menuFont, "Play");

            button1.BoundColor = Color.White;
            var button2 = new Button(menuFont, "Exit");

            button2.BoundColor = Color.White;
            menu = new MenuBox(new List <Button> {
                button1, button2
            }, 10);
        }
Exemple #5
0
        /// <summary>
        /// Valida que el ingreso sea un numero de pokedex válido
        /// </summary>
        /// <returns>Nro de dex válido</returns>
        public static short ValidarNroDex()
        {
            short dexValida;

            Console.Write($"\nIngrese un nro de dex [1-{PC.PokemonesEnDex}]: ");
            while (!short.TryParse(Console.ReadLine(), out dexValida) || (dexValida < 1 || dexValida > PC.PokemonesEnDex))
            {
                Menu.CambiarColor(ConsoleColor.Red);
                Console.WriteLine("El nro de dex es invalido, vuelva a intentarlo...");
                MenuBox.ResetearFondo();

                Console.Write($"\nIngrese un nro de dex [1-{PC.PokemonesEnDex}]: ");
            }

            return(dexValida);
        }
Exemple #6
0
        /// <summary>
        /// Valida y retorna un nivel que sea valido
        /// </summary>
        /// <param name="mensajeIngreso"></param>
        /// <returns></returns>
        public static byte ValidarNivel(string mensajeIngreso = "Ingresa un nivel [1-100]")
        {
            byte nivelValido;

            Console.Write("\n{0}: ", mensajeIngreso);

            while (!byte.TryParse(Console.ReadLine(), out nivelValido) || (nivelValido < 1 || nivelValido > PC.NivelMaximo))
            {
                Menu.CambiarColor(ConsoleColor.Red);
                Console.WriteLine("El nivel ingresado es invalido, vuelva a intentarlo...");
                MenuBox.ResetearFondo();
                Console.Write("\n{0}: ", mensajeIngreso);
            }

            return(nivelValido);
        }
Exemple #7
0
        /// <summary>
        /// Valida que la posicion ingresada se encuentre dentro de la box
        /// </summary>
        /// <returns></returns>
        public static int ValidarId()
        {
            int posValida;

            Console.Write($"\nIngrese una posicion de la box [1-{Box.Capacidad}]: ");
            while (!int.TryParse(Console.ReadLine(), out posValida) || (posValida < 1 || posValida > Box.Capacidad))
            {
                Menu.CambiarColor(ConsoleColor.Red);
                Console.WriteLine("La posicion ingresada es inválida, vuelva a intentarlo...");
                MenuBox.ResetearFondo();

                Console.Write($"\nIngrese una posicion de la box [1-{Box.Capacidad}]: ");
            }

            //Debo reducir en uno la posicion para que coincida con el array
            return(--posValida);
        }
Exemple #8
0
    // Update is called once per frame
    void Update()
    {
        KBEngine.Entity entity = KBEngineApp.app.player();
        KBEngine.Avatar avatar = null;
        if (entity != null && entity.className == "Avatar")
        {
            avatar = (KBEngine.Avatar)entity;
        }

        if (avatar != null)
        {
            text_pos.text = avatar.position.x.ToString("#.0") + "," + avatar.position.z.ToString("#.0");

            foreach (Skill sk in SkillBox.inst.skills)
            {
                sk.updateTimer(Time.deltaTime);//更新技能的冷却时间
            }
        }
        if (Input.GetMouseButtonDown(0))
        {
            Ray        ray = Camera.main.ScreenPointToRay(Input.mousePosition);
            RaycastHit hit;
            if (Physics.Raycast(ray, out hit, 100.0f, 1 << LayerMask.NameToLayer("CanAttack")))
            {
                UI_Target ui_target = World.instance.getUITarget();
                ui_target.GE_target = hit.collider.GetComponent <GameEntity>();
                ui_target.UpdateTargetUI();

                string name = Utility.getPreString(ui_target.GE_target.name);
                if (name == "NPC" && !MenuBox.hasMenu())
                {
                    Int32 id   = Utility.getPostInt(ui_target.GE_target.name);
                    NPC   _npc = (NPC)KBEngineApp.app.findEntity(id);

                    if (_npc != null)
                    {
                        UInt32 dialogID = _npc.dialogID;
                        avatar.dialog(id, dialogID);
                    }
                }
            }
        }
        //更新消耗品计时器
        ConsumeLimitCD.instance.Update(Time.deltaTime);
    }
Exemple #9
0
        /// <summary>
        /// Valida que el ingreso sea una cadena que no sea nula ni vacia.
        /// </summary>
        /// <params> El mensaje de ingreso </params>
        /// <returns>Cadena válida</returns>
        public static string ValidarCadena(string mensajeIngreso)
        {
            string cadenaIngresada;

            Console.Write("\n{0}: ", mensajeIngreso);
            cadenaIngresada = Console.ReadLine();

            while (string.IsNullOrEmpty(cadenaIngresada.Trim()))
            {
                Menu.CambiarColor(ConsoleColor.Red);
                Console.WriteLine("El nombre ingresado es invalido, vuelva a intentarlo...");
                MenuBox.ResetearFondo();
                Console.Write("\n{0}: ", mensajeIngreso);
                cadenaIngresada = Console.ReadLine();
            }

            return(cadenaIngresada);
        }
Exemple #10
0
        /// <summary>
        /// Valida la cantidad de pasos ingresados que requiere un huevo para eclosionar
        /// </summary>
        /// <returns></returns>
        public static short ValidarCantPasos()
        {
            short cantPasos;

            Console.Write("\nIngrese la cantidad de pasos: ");

            while (!short.TryParse(Console.ReadLine(), out cantPasos) || cantPasos < 1)
            {
                Menu.CambiarColor(ConsoleColor.Red);
                Console.WriteLine("La cantidad de pasos es inválida, vuelva a ingresarla...");


                MenuBox.ResetearFondo();
                Console.Write("\nIngrese la cantidad de pasos: ");
            }

            return(cantPasos);
        }
Exemple #11
0
        /// <summary>
        /// Valida el tipo del pokemon seleccionado por el usuario
        /// </summary>
        /// <returns></returns>
        public static Tipo ValidarTipo()
        {
            Console.WriteLine("\nTipos de pokemon: ");
            OpcionesTipo();

            Console.Write("Seleccione una opcion: ");
            Tipo tipoSeleccionado;

            //No vamos a tener en cuenta el tipo 'No asignado'. Es unicamente para los huevos.
            while (!Enum.TryParse <Tipo>(Console.ReadLine(), out tipoSeleccionado) || !Enum.IsDefined(typeof(Tipo), tipoSeleccionado) || tipoSeleccionado == 0)
            {
                Menu.CambiarColor(ConsoleColor.Red);
                Console.WriteLine("El tipo seleccionado no es valido, vuelva a intentarlo");
                MenuBox.ResetearFondo();
                Console.Write("Seleccione una opcion: ");
            }

            return(tipoSeleccionado);
        }
 void Update()
 {
     if (toggleVar == 1)
     {
         DialogueBox.SetActive(true);
         showMenuScript.PrintText();
         if (showMenuScript.isDone == true)
         {
             MenuBox.SetActive(true);
             Cursor.visible   = true;
             Cursor.lockState = CursorLockMode.None;
         }
     }
     else
     {
         DialogueBox.SetActive(false);
         MenuBox.SetActive(false);
     }
 }
Exemple #13
0
 public void TestMenu15()
 {
     MenuBox.Show
     (
         new[]
     {
         "Option 1",
         "Option 2",
         "Option 3",
         "Option 4",
         "Option 5",
         "Option 6",
         "Option 7",
         "Option 8",
         "Option 9",
         "Option 10",
         "Option 11",
         "Option 12",
         "Option 13",
         "Option 14",
         "Option 15"
     },
         new UnityAction[]
     {
         () => MessageBox.Show("You clicked on Option 1"),
         () => MessageBox.Show("You clicked on Option 2"),
         () => MessageBox.Show("You clicked on Option 3"),
         () => MessageBox.Show("You clicked on Option 4"),
         () => MessageBox.Show("You clicked on Option 5"),
         () => MessageBox.Show("You clicked on Option 6"),
         () => MessageBox.Show("You clicked on Option 7"),
         () => MessageBox.Show("You clicked on Option 8"),
         () => MessageBox.Show("You clicked on Option 9"),
         () => MessageBox.Show("You clicked on Option 10"),
         () => MessageBox.Show("You clicked on Option 11"),
         () => MessageBox.Show("You clicked on Option 12"),
         () => MessageBox.Show("You clicked on Option 13"),
         () => MessageBox.Show("You clicked on Option 14"),
         () => MessageBox.Show("You clicked on Option 15")
     },
         "Fifteen Item Test Menu"
     );
 }
Exemple #14
0
        /// <summary>
        /// Valida el genero del pokemon seleccionado por el usuario
        /// </summary>
        /// <returns></returns>
        public static Genero ValidarGenero()
        {
            Console.WriteLine("\nTipos de género: ");
            OpcionesGenero();

            Genero generoSeleccionado;

            Console.Write("Seleccione una opcion: ");

            //Existen pokemones que no tienen Genero. Por ejemplo, Ditto.
            while (!Enum.TryParse <Genero>(Console.ReadLine(), out generoSeleccionado) || !Enum.IsDefined(typeof(Genero), generoSeleccionado))
            {
                Menu.CambiarColor(ConsoleColor.Red);
                Console.WriteLine("El tipo seleccionado no es valido, vuelva a intentarlo");
                MenuBox.ResetearFondo();
                Console.Write("\nSeleccione una opcion: ");
            }

            return(generoSeleccionado);
        }
Exemple #15
0
        /// <summary>
        /// Valida la pokebola con la que se atrapo el pokemon seleccionado por el usuario
        /// </summary>
        /// <returns></returns>
        public static Pokebola ValidarPokebola()
        {
            Console.WriteLine("\nTipos de Pokebola: ");
            OpcionesPokebola();

            Console.Write("Seleccione una opcion: ");

            Pokebola pokebolaSeleccionada;

            //No vamos a tener en cuenta la pokebola 'No asignada'. Es unicamente para los huevos.
            while (!Enum.TryParse <Pokebola>(Console.ReadLine(), out pokebolaSeleccionada) || !Enum.IsDefined(typeof(Pokebola), pokebolaSeleccionada) || pokebolaSeleccionada == 0)

            {
                Menu.CambiarColor(ConsoleColor.Red);
                Console.WriteLine("El tipo seleccionado no es valido, vuelva a intentarlo");
                MenuBox.ResetearFondo();
                Console.Write("\nSeleccione una opcion: ");
            }

            return(pokebolaSeleccionada);
        }
Exemple #16
0
 public void TestMenu5()
 {
     MenuBox.Show
     (
         new[]
     {
         "Option 1\nOption description can go here.",
         "Option 2\nTwo",
         "Option 3\nThree",
         "Option 4\nFour",
         "Option 5\nFive of Nine?"
     },
         new UnityAction[]
     {
         () => MessageBox.Show("You clicked on Option 1"),
         () => MessageBox.Show("You clicked on Option 2"),
         () => MessageBox.Show("You clicked on Option 3"),
         () => MessageBox.Show("You clicked on Option 4"),
         () => MessageBox.Show("You clicked on Option 5")
     }
     );
 }
Exemple #17
0
    void Update()
    {
        totalCost = (sword.GetAmount() * sword.GetPrice()) + (axe.GetAmount() * axe.GetPrice()) + (gunner.GetAmount() * gunner.GetPrice()) + (looter.GetAmount() * looter.GetPrice());
        UpdateGUI();
        if (toggleVar == 1)
        {
            DialogueBox.SetActive(true);
            showMenuScript.PrintText();
            if (showMenuScript.isDone == true)
            {
                MenuBox.SetActive(true);
                ShowMenu();

                Cursor.visible   = true;
                Cursor.lockState = CursorLockMode.None;
            }
        }
        else
        {
            DialogueBox.SetActive(false);
            MenuBox.SetActive(false);
        }
    }
        private void BtnEnt_Click(object sender, RoutedEventArgs e)
        {
            if (CheckInput("inputVal", "errField"))
            {
                MainWindow.user = MainWindow.db.GetUser(TbInputLogin.Text, PbInputPassword.Password, out Exception exc);

                if (MainWindow.user != null)
                {
                    // внесение информации в БД о входе пользователя
                    MainWindow.db.AddLoggedHistory(MainWindow.user);

                    // переход в профиль пользователя
                    //MainWindow._MainFrame.Navigate(new PageUserProfile());

                    MainWindow._MainFrame.Navigate(null);

                    MenuBox.Menu();
                }
                else
                {
                    MessageBox.Show("Ошибка авторизации" + exc);
                }
            }
        }
Exemple #19
0
        /// <summary>
        /// Valida los ataques ingresados por el usuario
        /// </summary>
        /// <returns>Un array con los ataques cargados</returns>
        public static string[] ValidarAtaques()
        {
            string[]       ataquesIngresados = new string[Pokemon.LimiteAtaques];
            bool           finalizarCarga    = false;
            bool           seguirPreguntando;
            ConsoleKeyInfo respuesta;

            for (int pos = 0; pos < ataquesIngresados.Length; pos++)
            {
                #region Ingreso de ataques
                string ataqueIngresado;

                Console.Write($"\nIngrese el ataque {pos + 1}/4: ");
                ataqueIngresado = Console.ReadLine();

                //Validar nombre ataque
                while (string.IsNullOrEmpty(ataqueIngresado.Trim()))
                {
                    Menu.CambiarColor(ConsoleColor.Red);
                    Console.WriteLine("El ataque ingresado no es valido, vuelva a intentarlo...");
                    MenuBox.ResetearFondo();

                    Console.Write($"\nIngrese el ataque {pos + 1}/4: ");
                    ataqueIngresado = Console.ReadLine();
                }

                ataquesIngresados[pos] = ataqueIngresado;
                #endregion

                #region Se le pregunta al usuario si desea seguir agregando

                //Ultima posicion no pregunta
                if (pos == ataquesIngresados.Length - 1)
                {
                    break;
                }

                do
                {
                    seguirPreguntando = false;

                    Console.Write("\nDesea seguir agregando ataques? [S/N]: ");
                    respuesta = Console.ReadKey();

                    if (respuesta.Key == ConsoleKey.N)
                    {
                        finalizarCarga = true;
                        break;
                    }
                    else if (respuesta.Key != ConsoleKey.S)
                    {
                        Menu.CambiarColor(ConsoleColor.Red);
                        Console.WriteLine("\nLa tecla presionada es invalida, vuelva a intentarlo..");
                        seguirPreguntando = true;
                    }

                    MenuBox.ResetearFondo();
                } while (seguirPreguntando);

                Console.WriteLine();

                //Dejar de cargar ataques
                if (finalizarCarga)
                {
                    break;
                }
                #endregion
            }

            return(ataquesIngresados);
        }
Exemple #20
0
        /// <summary>
        ///     main render method
        /// </summary>
        public override void Render()
        {
            BorrarPantalla();
            if (showMenu)
            {
                //TODO -> mostrar menu inicial
                return;
            }
            if (!FinishedLoading)
            {
                return;
            }



            crono.render(ElapsedTime);
            preRenderPointLight(); //render 1
            //preRenderNiebla(); //render2, rompe con la luz por eso esta comentado

            IniciarScene(); //empiezo main escena

            //cilindroBB.render();
            //PreRenderPersonalizado(); //para el shadowMapFIX

            if (GodModeOn)
            {
                DibujarDebug();
            }
            var posCamara = AutoJugador.CamaraAuto.Position;

            //foreach (Auto a in Autos)
            //{
            //    foreach (LuzFija luz in LucesLst)
            //    {
            //        luz.setValues(a.Mesh, posCamara);
            //    }

            //    a.Render();
            //}

            foreach (TgcMesh mesh in MapScene.Meshes)
            {
                //rendereo solo lo que esta dentro del frustrum
                var c = TgcCollisionUtils.classifyFrustumAABB(Frustum, mesh.BoundingBox);
                if (c != TgcCollisionUtils.FrustumResult.OUTSIDE)
                {
                    mesh.render();
                }
            }
            DrawText.drawText(AutoJugador.Velocidad.ToString(), 20, 50, Color.Orange);
            //skybox render


            //render de menubox solo cuando es necesario.
            if (GodModeOn == true && MenuBox != null)
            {
                MenuBox.Render();
            }
            //Dibujo los sprites2d en pantalla
            Velocimetro.Render();

            autoOponente.render();
            SkyBox.render();
            RenderAxis();
            RenderFPS();
            AutoJugador.Render();
            TerminarScene(); //termino main scene
            ImprimirPantalla();
        }
Exemple #21
0
        private void LoadControls()
        {
            HandleDestroyed += new EventHandler(MineMain_HandleDestroyed);

            mineSetting = new MineSetting();
            mineSetting.HandleCreated += new EventHandler(mineSetting_HandleCreated);

            minePalette              = new MinePalette();
            minePalette.MessageSize += new MessageSizeEventHandler(minePalette_MessageSize);
            minePalette.Location     = new Point(0, 20);
            this.Controls.Add(minePalette);
            setting                     = minePalette.Setting;
            render                      = new MenuItemRender();
            render.ImageList            = new ImageList();
            render.ImageList.ColorDepth = ColorDepth.Depth32Bit;
            render.ImageList.ImageSize  = new System.Drawing.Size(32, 32);
            render.ImageList.Images.Add(Properties.Resources.help);
            render.ImageList.Images.Add(Properties.Resources.about);
            render.ImageList.Images.Add(Properties.Resources.begin);
            render.ImageList.Images.Add(Properties.Resources.sound);
            render.ImageList.Images.Add(Properties.Resources.soundGray);
            render.ImageList.Images.Add(Properties.Resources.color);
            render.ImageList.Images.Add(Properties.Resources.colorGray);
            render.ImageList.Images.Add(Properties.Resources.customer);
            render.ImageList.Images.Add(Properties.Resources.exit);
            contextMenuHelp = new ContextMenu();
            useHelp         = new MenuItem("使用帮助");
            render.SetEnable(useHelp, true);
            render.SetImageIndex(useHelp, 0);
            useHelp.Click += new EventHandler(useHelp_Click);
            contextMenuHelp.MenuItems.Add(useHelp);
            aboutMine = new MenuItem("关于扫雷");
            render.SetEnable(aboutMine, true);
            render.SetImageIndex(aboutMine, 1);
            aboutMine.Click += new EventHandler(aboutMine_Click);
            contextMenuHelp.MenuItems.Add(aboutMine);

            contextMenuGame = new ContextMenu();
            menuItemBegin   = new MenuItem("开局");
            render.SetEnable(menuItemBegin, true);
            render.SetImageIndex(menuItemBegin, 2);
            menuItemBegin.Click += new EventHandler(menuItemBegin_Click);
            contextMenuGame.MenuItems.Add(menuItemBegin);
            menuItemVoice = new MenuItem("声音");
            render.SetEnable(menuItemVoice, true);
            if (minePalette.Setting.AllowVoice)
            {
                render.SetImageIndex(menuItemVoice, 3);
            }
            else
            {
                render.SetImageIndex(menuItemVoice, 4);
            }
            menuItemVoice.Click += new EventHandler(menuItemVoice_Click);
            contextMenuGame.MenuItems.Add(menuItemVoice);
            menuItemColor = new MenuItem("颜色");
            render.SetEnable(menuItemColor, true);
            if (minePalette.Setting.AllowColor)
            {
                render.SetImageIndex(menuItemColor, 5);
            }
            else
            {
                render.SetImageIndex(menuItemColor, 6);
            }
            menuItemColor.Click += new EventHandler(menuItemColor_Click);
            contextMenuGame.MenuItems.Add(menuItemColor);
            menuItemCustom = new MenuItem("设置");
            render.SetEnable(menuItemCustom, true);
            render.SetImageIndex(menuItemCustom, 7);
            menuItemCustom.Click += new EventHandler(menuItemCustom_Click);
            contextMenuGame.MenuItems.Add(menuItemCustom);
            menuItemExit = new MenuItem("退出");
            render.SetEnable(menuItemExit, true);
            render.SetImageIndex(menuItemExit, 8);
            menuItemExit.Click += new EventHandler(menuItemExit_Click);
            contextMenuGame.MenuItems.Add(menuItemExit);

            menuBox                   = new MenuBox();
            menuItemGame              = new MenuBoxItem();
            menuItemGame.Text         = "游戏";
            menuItemGame.DropDownMenu = contextMenuGame;
            menuItemHelp              = new MenuBoxItem();
            menuItemHelp.Text         = "帮助";
            menuItemHelp.DropDownMenu = contextMenuHelp;
            menuBox.Items.Add(menuItemGame);
            menuBox.Items.Add(menuItemHelp);

            rebar        = new Rebar();
            rebar.Dock   = DockStyle.Top;
            rebar.Height = 20;
            band         = new RebarBand("扫雷 1.0", menuBox);
            rebar.Bands.Add(band);
            this.Controls.Add(rebar);
        }
Exemple #22
0
 public void OpenMenu()
 {
     CoverMenu.IsVisible = true;
     CoverMenu.FadeTo(1, 250, Easing.CubicOut);
     MenuBox.TranslateTo(0, 0, 250, Easing.CubicOut);
 }
		protected virtual void Decorate(MenuBox menuBox)
		{
			FillRectangle(menuBox.ButtonOrigin, menuBox.ButtonSize, Corner.None, FillType.Background, menuBox.HitState, AnchorLocation.SE);
			StrokeRectangle(menuBox.ButtonOrigin, menuBox.ButtonSize, Corner.None, menuBox.HitState);
		}
Exemple #24
0
 public void CloseMenu()
 {
     CoverMenu.FadeTo(0, 250, Easing.CubicOut);
     MenuBox.TranslateTo(-MenuBox.Width, 0, 250, Easing.CubicOut);
     CoverMenu.IsVisible = false;
 }
Exemple #25
0
 // Use this for initialization
 void Start()
 {
     MenuBox = GameObject.Find("MenuBox");
     MenuBox.SetActive(false);
 }
		public ControlsScene(Viewport viewport) : base(viewport)
		{
			Name = "Controls";
			
			// add an ActorInteractor to the viewport
			PrimaryInteractor = new ActorInteractor(this);
			
			
			// load the mwx file
			var mwx = new MwxSource(ResourceHelper.GetStream("demo.mwx"));
			
			
			// northeast buttons
			var cornerButtons = new CornerButtons(Corner.NE);
			//			cornerButtons.Image1 = Image.GetIcon("apply", 22);
			cornerButtons.Action1 += delegate(object sender, EventArgs e) {
				   Console.WriteLine("clicked apply");
			   };
			//			cornerButtons.Image2 = Image.GetIcon("cancel", 22);
			cornerButtons.Action2 += delegate(object sender, EventArgs e) {
				   Console.WriteLine("clicked cancel");
			   };
			var cornerAnchor = new AnchorPane(cornerButtons, AnchorLocation.NE);
			RenderList.AddOverlay(cornerAnchor);
			
			
			// northwest buttons
			cornerButtons = new CornerButtons(Corner.NW);
			//			cornerButtons.Image1 = Image.GetIcon("zoom-in", 22);
			cornerButtons.Action1 += delegate(object sender, EventArgs e) {
				  Console.WriteLine("clicked zoom-in");
			  };
			//			cornerButtons.Image2 = Image.GetIcon("zoom-out", 22);
			cornerButtons.Action2 += delegate(object sender, EventArgs e) {
				  Console.WriteLine("clicked zoom-out");
			  };
			cornerAnchor = new AnchorPane(cornerButtons, AnchorLocation.NW);
			RenderList.AddOverlay(cornerAnchor);
			
			
			// east control stack
			var stack = new Stack();
			stack.Orientation = Orientation.Vertical;
			
			var image = new Image(ResourceHelper.GetStream("plugin.png"));
			//			var image = Image.GetIcon("apply", 48);
			var button = new Button("Apply", image) { ButtonStyle = ButtonStyle.ImageOverLabel };
			button.Clicked += delegate(object sender, EventArgs e) {
				 Console.WriteLine("clicked apply");
			 };
			stack.AddChild(button);
			
			//			image = Image.GetIcon("cancel", 48);
			button = new Button("Cancel", image) { ButtonStyle = ButtonStyle.ImageOverLabel };
			button.Clicked += delegate(object sender, EventArgs e) {
				 Console.WriteLine("clicked cancel");
			 };
			stack.AddChild(button);
			
			var menuBox = new MenuBox();
			menuBox.Parse("One,Two,Three,Four");
			stack.AddChild(menuBox);
			
			var toolAnchor = new AnchorPane(stack, AnchorLocation.E);
			RenderList.AddOverlay(toolAnchor);
			
			
			// the controls dialog
			var controlsDialog = mwx.Get<Dialog>("controls-dialog");
			
			// attach the slider to its value label
			var slider = mwx.Get<Slider>("slider");
			var sliderValue = mwx.Get<Label>("sliderValue");
			sliderValue.Body = slider.Value.ToString("##.##");
			slider.ValueChanged += delegate(object sender, DoubleChangedEvent evt)
			{
				sliderValue.Body = evt.NewValue.ToString("##.##");
			};
			
			// attach the ForceStep checkbox to the slider
			var forceStepCheck = mwx.Get<CheckBox>("forceStepCheck");
			forceStepCheck.CheckChanged += delegate(object sender, BoolChangedEvent evt)
			{
				slider.ForceStep = evt.NewValue;
			};
			
			// floating toolbar
			var toolbar = new ToolBar();
			toolbar.Orientation = Orientation.Vertical;
			toolbar.ButtonStyle = ButtonStyle.ImageNextToLabel;
			
			//			image = Image.GetIcon("controls-dialog", 48);
			button = new Button("General Controls", image);
			button.Clicked += delegate(object sender, EventArgs e) { 
				ShowModal(controlsDialog);
			};
			toolbar.AddChild(button);
			
			
			// the progress dialog
			var progressDialog = mwx.Get<Dialog>("progress-dialog");
			
			// attach the slider to the progress bars
			var progressSlider = mwx.Get<Slider>("progressSlider");
			var progressBarH = mwx.Get<ProgressBar>("progressBarH");
			var progressBarV = mwx.Get<ProgressBar>("progressBarV");
			var progressDial = mwx.Get<ProgressDial>("progressDial");
			progressBarH.Value = progressSlider.Value;
			progressBarV.Value = progressSlider.Value;
			progressDial.Value = progressSlider.Value;
			progressSlider.ValueChanged += delegate(object sender, DoubleChangedEvent evt)
			{
				progressBarH.Value = progressSlider.Value;
				progressBarV.Value = progressSlider.Value;
				progressDial.Value = progressSlider.Value;
			};
			
			image = new Image(ResourceHelper.GetStream("radial-progress.png"));
			button = new Button("Progress Indicators", image);
			button.Clicked += delegate(object sender, EventArgs e) { 
				ShowModal(progressDialog);
			};
			toolbar.AddChild(button);
			
			// the tree view dialog
			var treeDialog = mwx.Get<Dialog>("tree-dialog");
			
			image = new Image(ResourceHelper.GetStream("view-tree.png"));
			button = new Button("Tree View", image);
			button.Clicked += delegate(object sender, EventArgs e) { 
				ShowModal(treeDialog);
			};
			toolbar.AddChild(button);
			
			var toolActor = new ActorPane(toolbar);
			toolActor.Normal = new Vector(0, -1, 0);
			RenderList.AddActor(toolActor);
			toolActor.ComputeGeometry();
			
			
			// the ring bar
			var ringBar = mwx.Get<RingBar>("ring-bar");
			toolActor = new ActorPane(ringBar);
			toolActor.Normal = new Vector(1, 0, 0);
			toolActor.Origin.Y = -192;
			toolActor.XAxis = new Vector(0, 1, 0);
			RenderList.AddActor(toolActor);
			toolActor.ComputeGeometry();

			mwx.Get<RingButton>("forward-button").Clicked += delegate {
				Console.WriteLine("forward pushed");
			};
			mwx.Get<RingButton>("backward-button").Clicked += delegate {
				Console.WriteLine("backward pushed");
			};
			mwx.Get<RingButton>("play-button").Clicked += delegate {
				Console.WriteLine("play pushed");
			};
			mwx.Get<RingButton>("pause-button").Clicked += delegate {
				Console.WriteLine("pause pushed");
			};


			var sceneInfo = new SceneInfoOverlay(this);
			RenderList.AddOverlay(sceneInfo);

			Camera.SetViewDirection(ViewDirection.Standard);
		}
 public void Render()
 {
     MenuBox.render();
 }
Exemple #28
0
        private void SetUserInfoToTopMenu()
        {
            MenuBox mwcMenuBox = (MenuBox)Parent.FindControl("mwcMenuBox");

            mwcMenuBox.UserInfo();
        }