Пример #1
0
        public void ProgressBarDlg()
        {
            gui.InitDialog(false, false);

            int W  = GuiController.Instance.Panel3d.Width;
            int H  = GuiController.Instance.Panel3d.Height;
            int x0 = -20;
            int y0 = 100;
            int dy = 350;
            int dx = W + 50;

            gui_item frame = gui.InsertFrame("Cargando mision", x0, y0, dx, dy, Color.FromArgb(240, 240, 240), frameBorder.sin_borde);

            frame.c_font = Color.FromArgb(0, 0, 0);
            progress_bar = gui.InsertProgressBar(ID_PROGRESS1, 50, y0 + 150, W - 100, 60);

            Device d3dDevice     = GuiController.Instance.D3dDevice;
            int    cant_textures = 5;

            progress_bar.SetRange(0, cant_textures, "Descargando archivos..");
            progress_bar.SetPos(1);
            for (int i = 0; i < cant_textures; ++i)
            {
                progress_bar.SetPos(i);
                progress_bar.text = "Descargando archivo: " + MyMediaDir + "f1\\piso3.png";

                Texture textura_piso = Texture.FromBitmap(d3dDevice, (Bitmap)Bitmap.FromFile(MyMediaDir + "f1\\piso3.png"), Usage.None, Pool.Managed);
                textura_piso.Dispose();
                MessageLoop();
            }

            gui.EndDialog();            // progress bar dialog
        }
Пример #2
0
        /// <summary>
        /// Dialog que muestra todas las categorias de texturas disponibles que hay.
        /// Al hacer clic te abre un segundo Dialog con las texturas dentro de esa categoria.
        /// </summary>
        public void TextureGroupDlg(DXGui gui)
        {
            // Inicio un dialogo modalless
            gui.InitDialog(false, false);

            int W = GuiController.Instance.Panel3d.Width;
            int H = GuiController.Instance.Panel3d.Height;

            int x0 = 20;
            int y0 = 50;
            int dy = 500;
            int dx = W - 40;
            int r  = 250;

            gui.InsertFrame("Seleccione la categoría", x0, y0, dx, dy, Color.FromArgb(192, 192, 192), frameBorder.redondeado);

            //int sdx = 400;
            //int sdy = 120;
            //gui.InsertKinectScrollButton(0, "scroll_left.png", x0 + 40, y0 + dy - sdy - 50, sdx, sdy);
            //gui.InsertKinectScrollButton(1, "scroll_right.png", x0 + 40 + sdx + 20, y0 + dy - sdy - 50, sdx, sdy);
            gui_item cancel_btn = gui.InsertKinectCircleButton(1, "Cancel", "cancel.png", W - gui.KINECT_BUTTON_SIZE_X - 40,
                                                               y0 + 20, gui.KINECT_BUTTON_SIZE_X);

            cancel_btn.scrolleable = false;      // fijo el boton de cancelar

            //Crear un boton por cada grupo de textura
            for (int i = 0; i < grupos.Count; i++)
            {
                Group g = grupos[i];
                gui.InsertKinectCircleButton(g.guiId, g.name, g.iconPath, x0 + 50 + i * (r + 20), y0 + 160, r);
            }
        }
Пример #3
0
        public void Configurar()
        {
            gui.InitDialog(false, false);
            profiling = true;
            int      W     = GuiController.Instance.Panel3d.Width;
            int      H     = GuiController.Instance.Panel3d.Height;
            int      x0    = 50;
            int      y0    = 50;
            int      dy    = H - 100;
            int      dx    = W - 100;
            gui_item frame = gui.InsertIFrame("Profiling", x0, y0, dx, dy, Color.FromArgb(140, 240, 140));

            frame.c_font = Color.FromArgb(0, 0, 0);
            gui.InsertButton(IDOK, "OK", x0 + dx - 300, y0 + dy - 60, 120, 60);
            gui.InsertButton(IDCANCEL, "Salir", x0 + dx - 140, y0 + dy - 60, 120, 60);
            gui.InsertItem("Configure el color", x0 + 50, y0 + 130);


            int cdx   = 50;
            int pos_x = x0 + 100;
            int pos_y = y0 + 220;
            int s     = 0;

            for (int i = 0; i < cant_colores; ++i)
            {
                gui_item item = gui.InsertItemColor(pos_x, pos_y, lst_colores[i], 1000 + i);
                if ((i + 1) % 4 == 0)
                {
                    if (s % 2 == 1)
                    {
                        pos_x = x0 + 100;
                    }
                    else
                    {
                        pos_x = x0 + 100 - 38;
                    }
                    pos_y += cdx / 2;
                    s++;
                }
                else
                {
                    pos_x += cdx + cdx / 2;
                }

                // uso el texto para meter el dato del nro de color
                item.text = "" + i;
            }
        }
Пример #4
0
        /// <summary>
        /// Dialog que muestra todas las texturas dentro de una categoria especifica.
        /// Al seleccionar una textura la aplica a todos los mesh que tenga esa categoria
        /// </summary>
        public void TextureDlg(DXGui gui, int groupId)
        {
            // Inicio un dialogo modalless
            gui.InitDialog(false, false);

            int W = GuiController.Instance.Panel3d.Width;
            int H = GuiController.Instance.Panel3d.Height;

            int x0  = -20;
            int y0  = 0;
            int dy  = 520;
            int dx  = W + 40;
            int tdx = 250;
            int tdy = 200;

            gui.InsertFrame("Seleccione la textura", x0, y0, dx, dy, Color.FromArgb(192, 192, 192), frameBorder.sin_borde);
            int sdx = 500;
            int sdy = 120;

            gui.InsertKinectScrollButton(0, "scroll_left.png", x0 + 40, y0 + dy - sdy - 50, sdx, sdy);
            gui.InsertKinectScrollButton(1, "scroll_right.png", x0 + 40 + sdx + 20, y0 + dy - sdy - 50, sdx, sdy);
            gui_item cancel_btn = gui.InsertKinectCircleButton(1, "Cancel", "cancel.png", W - gui.KINECT_BUTTON_SIZE_X - 40,
                                                               y0 + dy - gui.KINECT_BUTTON_SIZE_X - 50, gui.KINECT_BUTTON_SIZE_X);

            cancel_btn.scrolleable = false;      // fijo el boton de cancelar

            //Buscar grupo con ese id de gui
            selectedGroup = null;
            foreach (Group g in grupos)
            {
                if (g.guiId == groupId)
                {
                    selectedGroup = g;
                    break;
                }
            }


            //Crear un boton por cada textura dentro de este grupo
            for (int i = 0; i < selectedGroup.textures.Count; i++)
            {
                Texture t = selectedGroup.textures[i];
                gui.InsertKinectTileButton(t.guiId, (i + 1).ToString(), t.path, x0 + 50 + i * (tdx + 50), y0 + 100, tdx, tdy);
            }
        }
Пример #5
0
        public override void init()
        {
            GuiController.Instance.CustomRenderEnabled = true;
            Cursor.Hide();

            Device d3dDevice = GuiController.Instance.D3dDevice;

            MyMediaDir  = GuiController.Instance.ExamplesDir + "Shaders\\WorkshopShaders\\Media\\";
            MyShaderDir = GuiController.Instance.ExamplesDir + "Shaders\\WorkshopShaders\\Shaders\\";

            // levanto el GUI
            gui.Create();

            // menu principal
            gui.InitDialog(false, false);
            int      W    = GuiController.Instance.Panel3d.Width;
            int      H    = GuiController.Instance.Panel3d.Height;
            int      x0   = 70;
            int      y0   = 10;
            int      dy   = 30;
            int      dy2  = dy;
            int      dx   = 250;
            gui_item item = gui.InsertImage("transformers//custom_char.png", x0, y0);

            item.image_centrada = false;
            y0 += dy;
            gui.InsertItem(new static_text(gui, "SCOUT", x0, y0, 400, 25));
            y0  += 45;
            item = gui.InsertImage("transformers//scout.png", x0 + dx, y0);
            item.image_centrada = false;
            gui.InsertItem(new menu_item(gui, "SCOUT 1", "transformers//scout1.png", ID_SCOUT, x0, y0, dx, dy));
            y0 += dy + 5;
            gui.InsertItem(new menu_item(gui, "SCOUT 2", "transformers//scout2.png", ID_SCOUT, x0, y0, dx, dy));
            y0 += 2 * dy;


            gui.InsertItem(new static_text(gui, "HUNTER", x0, y0, 400, 25));
            y0  += 45;
            item = gui.InsertImage("transformers//hunter.png", x0 + dx, y0);
            item.image_centrada = false;
            menu_item hunter1 = (menu_item)gui.InsertItem(new menu_item(gui, "HUNTER 1", "transformers//hunter1.png", ID_HUNTER, x0, y0, dx, dy));

            hunter1.pos_imagen.Y = y0;

            y0 += 2 * dy;

            gui.InsertItem(new static_text(gui, "COMMANDER", x0, y0, 400, 25));
            y0  += 45;
            item = gui.InsertImage("transformers//commander.png", x0 + dx, y0);
            item.image_centrada = false;
            menu_item commander1 = (menu_item)gui.InsertItem(new menu_item(gui, "COMMANDER 1", "transformers//commander1.png", ID_COMMANDER, x0, y0, dx, 25));

            commander1.pos_imagen.Y = y0;
            y0 += 2 * dy;

            gui.InsertItem(new static_text(gui, "WARRIOR", x0, y0, 400, 25));
            y0  += 45;
            item = gui.InsertImage("transformers//warrior.png", x0 + dx, y0);
            item.image_centrada = false;
            menu_item warrior1 = (menu_item)gui.InsertItem(new menu_item(gui, "WARRIOR 1", "transformers//warrior1.png", ID_WARRIOR, x0, y0, dx, 30));

            warrior1.pos_imagen.Y = y0;

            dialog_sel = 0;
        }