Exemplo n.º 1
0
        public void ProgressBarDlg()
        {
            gui.InitDialog(false, false);

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

            GUIItem 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     = D3DDevice.Instance.Device;
            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: " + MediaDir + "Texturas\\f1\\f1piso2.png";

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

            gui.EndDialog();            // progress bar dialog
        }
Exemplo n.º 2
0
        public void Configurar()
        {
            gui.InitDialog(false, false);
            profiling = true;
            int     W     = D3DDevice.Instance.Width;
            int     H     = D3DDevice.Instance.Height;
            int     x0    = 50;
            int     y0    = 50;
            int     dy    = H - 100;
            int     dx    = W - 100;
            GUIItem 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)
            {
                GUIItem item = gui.InsertItemColor(pos_x, pos_y, lst_colores[i], 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;
            }
        }
Exemplo n.º 3
0
        public override void Init()
        {
            Cursor.Hide();

            Device d3dDevice = D3DDevice.Instance.Device;

            MyMediaDir  = MediaDir + "WorkshopShaders\\";
            MyShaderDir = ShadersDir + "WorkshopShaders\\";

            // levanto el GUI
            gui.Create(MediaDir);

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

            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, MediaDir);
            item.image_centrada = false;
            gui.InsertItem(new menu_item(gui, "SCOUT 1", "transformers//scout1.png", ID_SCOUT, x0, y0, MediaDir, dx, dy));
            y0 += dy + 5;
            gui.InsertItem(new menu_item(gui, "SCOUT 2", "transformers//scout2.png", ID_SCOUT, x0, y0, MediaDir, 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, MediaDir);
            item.image_centrada = false;
            menu_item hunter1 = (menu_item)gui.InsertItem(new menu_item(gui, "HUNTER 1", "transformers//hunter1.png", ID_HUNTER, x0, y0, MediaDir, 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, MediaDir);
            item.image_centrada = false;
            menu_item commander1 = (menu_item)gui.InsertItem(new menu_item(gui, "COMMANDER 1", "transformers//commander1.png", ID_COMMANDER, x0, y0, MediaDir, 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, MediaDir);
            item.image_centrada = false;
            menu_item warrior1 = (menu_item)gui.InsertItem(new menu_item(gui, "WARRIOR 1", "transformers//warrior1.png", ID_WARRIOR, x0, y0, MediaDir, dx, 30));

            warrior1.pos_imagen.Y = y0;

            dialog_sel = 0;
        }