• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Engine.Button类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Engine.Button的典型用法代码示例。如果您正苦于以下问题:C# Button类的具体用法?C# Button怎么用?C# Button使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Button类属于Engine命名空间,在下文中一共展示了Button类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: OKButton_Click

        private void OKButton_Click(Button sender)
        {
            if (clickHandler != null)
                clickHandler(sender);

            SetShouldDetach();
        }
开发者ID:AKNightHawk,项目名称:AssaultKnights2,代码行数:7,代码来源:MessageBoxWindow.cs


示例2: InitializeMenu

        private void InitializeMenu()
        {
            menuFont = new Font(textureManager.Get("menu_font"), FontParser.Parse("menuFont.fnt"));
            menu = new VerticalMenu(0, -100, input, new Color(1, 1, 1, 1), new Color(0, 0, 1, 1));

            // Create start, controls, exit for menu
            Button start = new Button(delegate(object sender, EventArgs e)
            {
                stateSystem.ChangeState("inner_game");
                ResetGameData();
            },
            new Text("Start", menuFont));

            Button controls = new Button(delegate(object sender, EventArgs e)
            {
                stateSystem.ChangeState("controls");
            },
            new Text("Controls", menuFont));

            Button exit = new Button(delegate(object sender, EventArgs e)
            {
                System.Windows.Forms.Application.Exit();
            },
            new Text("Exit", menuFont));

            menu.AddButton(start);
            menu.AddButton(controls);
            menu.AddButton(exit);
        }
开发者ID:beamery,项目名称:bTris,代码行数:29,代码来源:StartMenuState.cs


示例3: Init

        internal bool Init()
        {
            //buttons
            Button[] buttons = new Button[ 2 ];
            buttons[ 0 ] = new Button( JoystickButtons.Button1, 0 );
            buttons[ 1 ] = new Button( JoystickButtons.Button2, 1 );

            //axes
            Axis[] axes = new Axis[ 1 ];
            axes[ 0 ] = new JoystickInputDevice.Axis( JoystickAxes.X, new Range( -1, 1 ), false );

            //povs
            POV[] povs = new POV[ 0 ];
            //povs[ 0 ] = new JoystickInputDevice.POV( JoystickPOVs.POV1 );

            //sliders
            Slider[] sliders = new Slider[ 0 ];
            //sliders[ 0 ] = new Slider( JoystickSliders.Slider1 );

            //forceFeedbackController
            ForceFeedbackController forceFeedbackController = null;

            //initialize data
            InitDeviceData( buttons, axes, povs, sliders, forceFeedbackController );

            return true;
        }
开发者ID:huytd,项目名称:fosproject,代码行数:27,代码来源:ExampleCustomInputDevice.cs


示例4: MessageBoxWindow

        //

        public MessageBoxWindow(string messageText, string caption, string windowname, Button.ClickDelegate clickHandler)
        {
            this.messageText = messageText;
            this.caption = caption;
            this.Name = this.windowname = windowname;
            this.clickHandler = clickHandler;
        }
开发者ID:AKNightHawk,项目名称:AssaultKnights2,代码行数:9,代码来源:MessageBoxWindow.cs


示例5: InitializeMenu

        private void InitializeMenu()
        {
            _menu = new VerticalMenu(0, 150, _input);

            Color focusColor = new Color(251, 242, 0, 1);
            Color noFocusColor = new Color(0.14f, 0.57f, 0.14f, 1);

            Button startGame = new Button(
                delegate(object o, EventArgs e)
                {
                    _system.ChangeState("start_state");
                },
                new Text("Back To Start", _generalFont), focusColor, noFocusColor);

            Button exitGame = new Button(
                delegate(object o, EventArgs e)
                {
                    // Quit
                    System.Windows.Forms.Application.Exit();
                },
                new Text("Quit", _generalFont), focusColor, noFocusColor);

            _menu.AddButton(startGame);
            _menu.AddButton(exitGame);
        }
开发者ID:harvPrentiss,项目名称:Subway-Tetris,代码行数:25,代码来源:GameOverState.cs


示例6: InitializeMenu

        private void InitializeMenu()
        {
            _menu = new VerticalMenu(0, 150, _input);
            Button startGame = new Button(delegate(object o, EventArgs e) { _system.ChangeState("inner_game"); }, new Text("Start", _generalFont));
            Button gameSettings = new Button(delegate(object o, EventArgs e) { /*Go to settings */ }, new Text("Settings", _generalFont));
            Button exitGame = new Button(delegate(object o, EventArgs e) { /*Quit*/ System.Windows.Forms.Application.Exit(); }, new Text("Exit", _generalFont));

            _menu.AddButton(startGame);
            _menu.AddButton(gameSettings);
            _menu.AddButton(exitGame);
        }
开发者ID:Drahkir,项目名称:Shooter,代码行数:11,代码来源:StartMenuState.cs


示例7: Create

        public override void Create()
        {
            base.Create();

            GameObject cursorA = new Cursor(new XboxController(SlimDX.XInput.UserIndex.One));
            GameObject cursorB = new Cursor(new XboxController(SlimDX.XInput.UserIndex.Two));
            ObjectManager.AddGameObject(cursorA);
            ObjectManager.AddGameObject(cursorB);
            GameObject start = new Button(512, 256, "startbutton.png", Button.StateSwitch.NORMAL_MODE);

            ObjectManager.AddGameObject(start);
        }
开发者ID:QuantumPhi,项目名称:SpaceDefense,代码行数:12,代码来源:Menu.cs


示例8: InitializeMenu

        private void InitializeMenu()
        {
            _menu = new VerticalMenu(0, 150, _input);
            var startGame = new Button(delegate { _system.ChangeState("inner_game"); }, new Text("Start", _generalFont));
            var gameSettings = new Button(delegate
            {
                /* Go To Settings */
            }, new Text("Settings", _generalFont));
            var exitGame = new Button(delegate { Application.Exit(); }, new Text("Exit", _generalFont));

            _menu.AddButton(startGame);
            _menu.AddButton(gameSettings);
            _menu.AddButton(exitGame);
        }
开发者ID:Drahkir,项目名称:AnotherCastle,代码行数:14,代码来源:StartMenuState.cs


示例9: OnAttach

        ///////////////////////////////////////////
        protected override void OnAttach()
        {
            base.OnAttach();

            //disable check for disconnection
            GameEngineApp.Instance.Client_AllowCheckForDisconnection = false;

            //register config fields
            EngineApp.Instance.Config.RegisterClassParameters( GetType() );

            //create window
            window = ControlDeclarationManager.Instance.CreateControl(
                "Gui\\MultiplayerLoginWindow.gui" );
            Controls.Add( window );

            MouseCover = true;
            BackColor = new ColorValue( 0, 0, 0, .5f );

            //initialize controls

            buttonCreateServer = (Button)window.Controls[ "CreateServer" ];
            buttonCreateServer.Click += CreateServer_Click;

            buttonConnect = (Button)window.Controls[ "Connect" ];
            buttonConnect.Click += Connect_Click;

            ( (Button)window.Controls[ "Exit" ] ).Click += Exit_Click;

            //generate user name
            if( string.IsNullOrEmpty( userName ) )
            {
                EngineRandom random = new EngineRandom();
                userName = "Player" + random.Next( 1000 ).ToString( "D03" );
            }

            editBoxUserName = (EditBox)window.Controls[ "UserName" ];
            editBoxUserName.Text = userName;
            editBoxUserName.TextChange += editBoxUserName_TextChange;

            editBoxConnectTo = (EditBox)window.Controls[ "ConnectTo" ];
            editBoxConnectTo.Text = connectToAddress;
            editBoxConnectTo.TextChange += editBoxConnectTo_TextChange;

            SetInfo( "", false );
        }
开发者ID:whztt07,项目名称:SDK,代码行数:46,代码来源:MultiplayerLoginWindow.cs


示例10: InitializeMenu

        private void InitializeMenu()
        {
            _menu = new VerticalMenu(0, 150, _input);
            Button startGame = new Button(
                delegate(object o, EventArgs e)
                {
                    _system.ChangeState("inner_game");
                },
                new Text("Start", _generalFont));

            Button exitGame = new Button(
                delegate(object o, EventArgs e)
                {
                    // Quit
                    System.Windows.Forms.Application.Exit();
                },
                new Text("Exit", _generalFont));
            Button helpPage = new Button(
                delegate(object o, EventArgs e){
                    //change state to help page
                    _system.ChangeState("help_state");
                },
                new Text("Game Help", _generalFont));
            Button kabajie = new Button(
                delegate(object o, EventArgs e)
                {
                    //change state to help page
                    _system.ChangeState("kabajie");
                },
                new Text("Kabaji Egara", _generalFont));

            _menu.AddButton(startGame);
            _menu.AddButton(exitGame);
            _menu.AddButton(helpPage);
            _menu.AddButton(kabajie);
        }
开发者ID:pixare40,项目名称:gerishom-basweti,代码行数:36,代码来源:StartMenuState.cs


示例11: GuiTest_Click

 void GuiTest_Click( Button sender )
 {
     GameEngineApp.Instance.ControlManager.Controls.Add( new GuiTestWindow() );
 }
开发者ID:Eneth,项目名称:GAO,代码行数:4,代码来源:MainMenuWindow.cs


示例12: Exit_Click

 void Exit_Click( Button sender )
 {
     GameEngineApp.Instance.SetFadeOutScreenAndExit();
 }
开发者ID:Eneth,项目名称:GAO,代码行数:4,代码来源:MainMenuWindow.cs


示例13: EffectDestroy_Click

 void EffectDestroy_Click( Button sender )
 {
     ForceFeedbackEffect effect = GetSelectedEffect();
     if( effect != null )
         effect.Destroy();
 }
开发者ID:Eneth,项目名称:GAO,代码行数:6,代码来源:EngineProfilerWindow.cs


示例14: textureListButton_Click

            void textureListButton_Click( Button sender )
            {
                Texture[] textures = TextureManager.Instance.GetAllTextures();
                ArrayUtils.SelectionSort( textures, delegate( Texture texture1, Texture texture2 )
                {
                    return string.Compare( texture1.Name, texture2.Name );
                } );

                Log.Info( "List of textures in the memory:" );
                foreach( Texture texture in textures )
                    Log.Info( "{0}, {1}x{2}, {3}", texture.Name, texture.Size.X, texture.Size.Y, texture.Format );
                Log.Info( "TOTAL: {0}", textures.Length );

                if( EngineConsole.Instance != null )
                {
                    EngineConsole.Instance.Active = true;
                    EngineConsole.Instance.ScrollDown();
                }
            }
开发者ID:Eneth,项目名称:GAO,代码行数:19,代码来源:EngineProfilerWindow.cs


示例15: Run_Click

 void Run_Click( Button sender )
 {
     GameEngineApp.Instance.SetNeedMapLoad( "Maps\\MainDemo\\Map.map" );
 }
开发者ID:Eneth,项目名称:GAO,代码行数:4,代码来源:MainMenuWindow.cs


示例16: Profiler_Click

 void Profiler_Click( Button sender )
 {
     if( EngineProfilerWindow.Instance == null )
         Controls.Add( new EngineProfilerWindow() );
 }
开发者ID:Eneth,项目名称:GAO,代码行数:5,代码来源:MainMenuWindow.cs


示例17: Multiplayer_Click

 void Multiplayer_Click( Button sender )
 {
     Controls.Add( new MultiplayerLoginWindow() );
 }
开发者ID:Eneth,项目名称:GAO,代码行数:4,代码来源:MainMenuWindow.cs


示例18: LoadSave_Click

 void LoadSave_Click( Button sender )
 {
     Controls.Add( new WorldLoadSaveWindow() );
 }
开发者ID:Eneth,项目名称:GAO,代码行数:4,代码来源:MainMenuWindow.cs


示例19: Maps_Click

 void Maps_Click( Button sender )
 {
     Controls.Add( new MapsWindow() );
 }
开发者ID:Eneth,项目名称:GAO,代码行数:4,代码来源:MainMenuWindow.cs


示例20: btnPrevious_Click

        private void btnPrevious_Click(Button sender)
        {
            if (activeList == Active_List.None)
                return;

            int index = 0;
            int max = 0;
            UnitType u = null;
            string name = "No Name";
            int cost = 0;

            List<CustomizableUnit> list = null;

            switch (activeList)
            {
                case Active_List.Mech:
                    {
                        index = mechListIndex;
                        max = MechsPriceList.Type.PriceLists.Count;
                        list = MechDBUnits;
                    }
                    break;

                case Active_List.AirUnit:
                    {
                        index = airUnitListIndex;
                        max = AunitPriceList.Type.PriceLists.Count;
                        list = ADBUnits;
                    }
                    break;

                case Active_List.GroundUnit:
                    {
                        index = groundUnitListIndex;
                        max = GunitPriceList.Type.PriceLists.Count;
                        list = GDBUnits;
                    }
                    break;

                case Active_List.Jet:
                    {
                        index = jetUnitListIndex;
                        max = JunitPriceList.Type.PriceLists.Count;
                        list = JDBUnits;
                    }
                    break;
            }

            int newIndex = --index;
            if (newIndex < 0)
                newIndex = max - 1;

            switch (activeList)
            {
                case Active_List.Mech:
                    {
                        u = MechsPriceList.Type.PriceLists[newIndex].PricedUnit;
                        name = MechsPriceList.Type.PriceLists[newIndex].Name;
                        cost = MechsPriceList.Type.PriceLists[newIndex].Price;
                        mechListIndex = newIndex;
                    }
                    break;

                case Active_List.AirUnit:
                    {
                        u = AunitPriceList.Type.PriceLists[newIndex].PricedUnit;
                        name = AunitPriceList.Type.PriceLists[newIndex].Name;
                        cost = AunitPriceList.Type.PriceLists[newIndex].Price;
                        airUnitListIndex = newIndex;
                    }
                    break;

                case Active_List.GroundUnit:
                    {
                        u = GunitPriceList.Type.PriceLists[newIndex].PricedUnit;
                        name = GunitPriceList.Type.PriceLists[newIndex].Name;
                        cost = GunitPriceList.Type.PriceLists[newIndex].Price;
                        groundUnitListIndex = newIndex;
                    }
                    break;

                case Active_List.Jet:
                    {
                        u = JunitPriceList.Type.PriceLists[newIndex].PricedUnit;
                        name = JunitPriceList.Type.PriceLists[newIndex].Name;
                        cost = JunitPriceList.Type.PriceLists[newIndex].Price;
                        jetUnitListIndex = newIndex;
                    }
                    break;
            }
            spawner.SpawnUnit(u);

            bool alreadyPurchased = false;
            foreach (CustomizableUnit cu in list)
            {
                if (cu.Name == name)
                {
                    alreadyPurchased = true;
                    break;
                }
//.........这里部分代码省略.........
开发者ID:AKNightHawk,项目名称:AssaultKnights2,代码行数:101,代码来源:TechLabUnitBuyWindow.cs



注:本文中的Engine.Button类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Engine.Camera类代码示例发布时间:2022-05-24
下一篇:
C# CSV.ReadCSV类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap