예제 #1
0
파일: c_gui.cs 프로젝트: kindziora/csharpDX
        public bool initialize_form(ref c_input inp, string pfad)
        {
            ///////FORM/////////////////
            this.REF_input = inp;

            this.REF_texture = TextureLoader.FromFile(this.device, pfad + @"texturen\form.PNG", 514, 190, 0, 0, Format.Unknown, Pool.Default, Filter.None, Filter.None, Color.FromArgb(45, 45, 255).ToArgb());
            this.fontweight = FontWeight.Normal;
            this.font = new Microsoft.DirectX.Direct3D.Font(this.device, this.fontsize, (this.fontsize / 100) * 30, this.fontweight, 0, false, CharacterSet.Default, Precision.Default, FontQuality.Default, PitchAndFamily.DefaultPitch | PitchAndFamily.FamilyDoNotCare, "Palatino Linotype");
            this.textX = 15;
            this.textY = 19;
            this.col = Color.LemonChiffon;
            this.srcbox = new Rectangle(0, 0, 514, 190);
            this.movable = true;
            this.opacity = 255;
            ////////////////////////////
            return true;
        }
예제 #2
0
파일: c_gui.cs 프로젝트: kindziora/csharpDX
        public bool initialize_form(ref c_input inp, string pfad)
        {
            ///////FORM/////////////////
            this.REF_input   =  inp;

            this.REF_texture = TextureLoader.FromFile(this.device, pfad + @"texturen\form.PNG", 514 ,190 , 0, 0, Format.Unknown, Pool.Default, Filter.None, Filter.None, Color.FromArgb(45, 45, 255).ToArgb());
            this.fontweight  = FontWeight.Normal;
            this.font = new Microsoft.DirectX.Direct3D.Font(this.device, this.fontsize, (this.fontsize/100) *30, this.fontweight, 0, false, CharacterSet.Default, Precision.Default, FontQuality.Default, PitchAndFamily.DefaultPitch | PitchAndFamily.FamilyDoNotCare, "Palatino Linotype");
            this.Text = "Welcome in the new game!\n This is a new era and at first i like to say i love programingThe pixel shader code is similar to the vertex shader. Position and texture coordinate input comes from the vertex shader. Output is just the color of the final pixel. A texture is the only global variable. Inside the ps_main function, the texel at the specified coordinate is fetched and then blended (multiplied) with a certain color.!";
            this.textX = 15;
            this.textY = 19;
            this.col         = Color.LemonChiffon;
            this.srcbox = new Rectangle(0, 0, 514, 190);
            this.movable = true;
            ////////////////////////////

            /////////////////////ELEMENTE////////////////////////////////
            button_OK             = new gui_button(ref this.device, this.box.X + 205, this.box.Y + 140, 80, 25);
            button_OK.col         = Color.Khaki;
            button_OK.X           = 205;
            button_OK.Y           = 140;
            button_OK.hovereffekt = true;
            button_OK.colOnhover  = Color.Brown;
            button_OK.colnohover  = button_OK.col;

            button_OK.REF_input   = inp;
            button_OK.REF_sprite  = this.REF_sprite;
            button_OK.REF_texture = TextureLoader.FromFile(this.device, pfad + @"texturen\button.PNG", 100 ,30 , 0, 0, Format.Unknown, Pool.Default, Filter.None, Filter.None, Color.FromArgb(45, 45, 255).ToArgb());
            button_OK.fontweight = FontWeight.ExtraBold;
            button_OK.font = new Microsoft.DirectX.Direct3D.Font(this.device, 15, 7, button_OK.fontweight, 0, false, CharacterSet.Default, Precision.Default, FontQuality.Default, PitchAndFamily.DefaultPitch | PitchAndFamily.FamilyDoNotCare, "Verdana");
            button_OK.textX = 40;
            button_OK.textY = 8;
            button_OK.Text = "OK";

            button_OK.srcbox = new Rectangle(0, 0, 100, 30);

            /////////////////////////////////////////////////////////////

            return true;
        }
예제 #3
0
파일: c_gui.cs 프로젝트: kindziora/csharpDX
        public bool initialize_form(ref c_input inp, string pfad)
        {
            ///////FORM/////////////////
            this.REF_input = inp;

            this.REF_texture = TextureLoader.FromFile(this.device, pfad + @"texturen\Mgmenu.PNG", 350, 190, 0, 0, Format.Unknown, Pool.Default, Filter.None, Filter.None, Color.FromArgb(45, 45, 255).ToArgb());
            this.fontweight = FontWeight.Bold;
            this.fontsize = 25;
            this.font = new Microsoft.DirectX.Direct3D.Font(this.device, this.fontsize, 10, this.fontweight, 0, false, CharacterSet.Default, Precision.Default, FontQuality.Default, PitchAndFamily.DefaultPitch | PitchAndFamily.FamilyDoNotCare, "Palatino Linotype");
            this.Text = "Main Menu";
            this.textX = 110;
            this.textY = 19;
            this.col = Color.LemonChiffon;
            this.srcbox = new Rectangle(0, 0, 350, 190);

            this.movable = true;
            ////////////////////////////

            /////////////////////ELEMENTE////////////////////////////////

            button_close = new gui_button(ref this.device, this.box.X + 205, this.box.Y + 100, 80, 25);
            button_close.col = Color.Khaki;
            button_close.X = 100;
            button_close.Y = 100;
            button_close.hovereffekt = true;
            button_close.colOnhover = Color.SandyBrown;
            button_close.colnohover = button_close.col;

            button_close.REF_input = inp;
            button_close.REF_sprite = this.REF_sprite;
            button_close.REF_texture = TextureLoader.FromFile(this.device, pfad + @"texturen\button.PNG", 100, 30, 0, 0, Format.Unknown, Pool.Default, Filter.None, Filter.None, Color.FromArgb(45, 45, 255).ToArgb());
            button_close.fontweight = FontWeight.Bold;
            button_close.font = new Microsoft.DirectX.Direct3D.Font(this.device, 15,5, button_close.fontweight, 0, false, CharacterSet.Default, Precision.Default, FontQuality.Default, PitchAndFamily.DefaultPitch | PitchAndFamily.FamilyDoNotCare, "Verdana");
            button_close.textX = 20;
            button_close.textY = 8;
            button_close.Text = "return to Game";

            button_close.srcbox = new Rectangle(0, 0, 100, 30);
            button_close.box = new Rectangle((int)button_close.X, (int)button_close.Y, 150, 30);

            /////////BUTTON CLOSE GAME ////////////////////////

            button_cancelGame = new gui_button(ref this.device, this.box.X + 205, this.box.Y + 140, 80, 25);
            button_cancelGame.col = Color.Khaki;
            button_cancelGame.X = 100;
            button_cancelGame.Y = 140;
            button_cancelGame.hovereffekt = true;
            button_cancelGame.colOnhover = Color.SandyBrown;
            button_cancelGame.colnohover = button_cancelGame.col;

            button_cancelGame.REF_input = inp;
            button_cancelGame.REF_sprite = this.REF_sprite;
            button_cancelGame.REF_texture = button_close.REF_texture;
            button_cancelGame.fontweight = FontWeight.Bold;
            button_cancelGame.font = button_close.font;
            button_cancelGame.textX = 20;
            button_cancelGame.textY = 8;
            button_cancelGame.Text = "Close Game";

            button_cancelGame.srcbox = new Rectangle(0, 0, 100, 30);
            button_cancelGame.box = new Rectangle((int)button_cancelGame.X, (int)button_cancelGame.Y, 150, 30);

            /////////////////////////////////////////////////////////////

            return true;
        }
예제 #4
0
 private void init_Klassen()
 {
     MATHENGINE = new c_engine(); //berechnungen für die spielelogik etc
     INPUT = new c_input(GameDefinition.hwnd, GameDefinition.window);
     AUDIO = new c_audio(ref pRESOURCES);
     ZEICHENSPRITE = new Sprite(DEVICE); // einen sprite für das darstellungsgerät erstellen
 }