当前位置: 首页>>代码示例>>C#>>正文


C# GUI.GetControl方法代码示例

本文整理汇总了C#中GUI.GetControl方法的典型用法代码示例。如果您正苦于以下问题:C# GUI.GetControl方法的具体用法?C# GUI.GetControl怎么用?C# GUI.GetControl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GUI的用法示例。


在下文中一共展示了GUI.GetControl方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GameUIManager

        public GameUIManager()
        {
            UIMain uiMain = LKernel.GetG<UIMain>();

            //This mess gets the height and width of the window for centering UI entities.
            uint uheight, uwidth, colorDepth;
            int height, width;
            RenderWindow window = LKernel.GetG<RenderWindow>();
            window.GetMetrics(out uwidth, out uheight, out colorDepth);
            width = (int)uwidth;
            height = (int)uheight;

            inGameUI = uiMain.GetGUI("ingame gui");
            itembox = inGameUI.GetControl<PictureBox>("itembox");
            //itembox.Top = (height / 2);
            //itembox.Bottom = (height / 2);
            //itembox.Left = (width / 2);
            //itembox.Right = (width / 2);

            itemimage = inGameUI.GetControl<PictureBox>("itemimage");
            //itemimage.Top = (height / 2);
            //itemimage.Bottom = (height / 2);
            //itemimage.Left = (width / 2);
            //itemimage.Right = (width / 2);
        }
开发者ID:CisciarpMaster,项目名称:PonyKart,代码行数:25,代码来源:GameUIManager.cs

示例2: RaceResultUIHandler

 public RaceResultUIHandler()
 {
     winnerGui = LKernel.Get<UIMain>().GetGUI("winner gui");
     winnerLabel = winnerGui.GetControl<Label>("winner label");
     LapCounter.OnFirstFinish += new RaceFinishEvent(OnFirstFinish);
     winnerGui.Visible = false;
 }
开发者ID:CisciarpMaster,项目名称:PonyKart,代码行数:7,代码来源:RaceResultUIHandler.cs

示例3: MainMenuManager

        public MainMenuManager()
        {
            LevelManager.OnLevelLoad += new LevelEvent(OnLevelLoad);
            LevelManager.OnLevelPreUnload += new LevelEvent(OnLevelPreUnload);

            UIMain uiMain = LKernel.GetG<UIMain>();
            MenuBackgroundGui = uiMain.GetGUI("menu background gui");
            GameTypeGui = uiMain.GetGUI("menu game type gui");
            LevelSelectGui = uiMain.GetGUI("menu level select gui");
            NetworkHostGui = uiMain.GetGUI("menu host info gui");
            NetworkClientGui = uiMain.GetGUI("menu client info gui");
            LobbyGui = uiMain.GetGUI("menu lobby gui");
            CharacterSelectGui = uiMain.GetGUI("menu character select gui");
            OptionsGui = uiMain.GetGUI("menu options gui");

            // the checkers bit in the corner
            PictureBox checkersPicture = MenuBackgroundGui.GetControl<PictureBox>("checkers picture");
            checkersPicture.Bitmap = new Bitmap("media/gui/checkers.png");

            // set up events and stuff
            GameTypeGui.GetControl<Button>("game type single player button").MouseClick += (o, e) => Invoke(OnGameType_SelectSinglePlayer, o, e);
            GameTypeGui.GetControl<Button>("game type networked host button").MouseClick += (o, e) => Invoke(OnGameType_SelectNetworkedHost, o, e);
            GameTypeGui.GetControl<Button>("game type networked client button").MouseClick += (o, e) => Invoke(OnGameType_SelectNetworkedClient, o, e);
            GameTypeGui.GetControl<Button>("game type options button").MouseClick += (o, e) => Invoke(OnGameType_SelectOptions, o, e);
            GameTypeGui.GetControl<Button>("quit button").MouseClick += (o, e) => Launch.Quit = true;

            NetworkHostPortTextBox = NetworkHostGui.GetControl<TextBox>("host info port text box");
            NetworkHostPasswordTextBox = NetworkHostGui.GetControl<TextBox>("host info password text box");
            NetworkHostGui.GetControl<Button>("host info next button").MouseClick += (o, e) => Invoke(OnHostInfo_SelectNext, o, e);
            NetworkHostGui.GetControl<Button>("host info back button").MouseClick += (o, e) => Invoke(OnHostInfo_SelectBack, o, e);

            NetworkClientIPTextBox = NetworkClientGui.GetControl<TextBox>("client info IP text box");
            NetworkClientPortTextBox = NetworkClientGui.GetControl<TextBox>("client info port text box");
            NetworkClientPasswordTextBox = NetworkClientGui.GetControl<TextBox>("client info password text box");
            NetworkClientGui.GetControl<Button>("client info next button").MouseClick += (o, e) => Invoke(OnClientInfo_SelectNext, o, e);
            NetworkClientGui.GetControl<Button>("client info back button").MouseClick += (o, e) => Invoke(OnClientInfo_SelectBack, o, e);

            LobbyLabel = LobbyGui.GetControl<Label>("lobby label");
            LobbyGui.GetControl<Button>("lobby next button").MouseClick += (o, e) => Invoke(OnLobby_SelectNext, o, e);
            LobbyGui.GetControl<Button>("lobby back button").MouseClick += (o, e) => Invoke(OnLobby_SelectBack, o, e);

            LevelSelectGui.GetControl<Button>("level select flat button").MouseClick += (o, e) => Invoke(OnLevelSelect, o, e, "flat");
            LevelSelectGui.GetControl<Button>("level select testlevel button").MouseClick += (o, e) => Invoke(OnLevelSelect, o, e, "testlevel");
            LevelSelectGui.GetControl<Button>("level select SAA button").MouseClick += (o, e) => Invoke(OnLevelSelect, o, e, "SweetAppleAcres");
            LevelSelectGui.GetControl<Button>("level select WTW button").MouseClick += (o, e) => Invoke(OnLevelSelect, o, e, "WhitetailWoods");
            LevelSelectGui.GetControl<Button>("level select TestAI button").MouseClick += (o, e) => Invoke(OnLevelSelect, o, e, "TestAI");
            LevelSelectGui.GetControl<Button>("level select roulette button").MouseClick += (o, e) => Invoke(OnLevelSelect, o, e, "roulette");
            LevelSelectGui.GetControl<Button>("level select back button").MouseClick += (o, e) => Invoke(OnLevelSelect_SelectBack, o, e);

            CharacterSelectGui.GetControl<Button>("character select TS button").MouseClick += (o, e) => Invoke(OnCharacterSelect, o, e, "Twilight Sparkle");
            CharacterSelectGui.GetControl<Button>("character select RD button").MouseClick += (o, e) => Invoke(OnCharacterSelect, o, e, "Rainbow Dash");
            CharacterSelectGui.GetControl<Button>("character select AJ button").MouseClick += (o, e) => Invoke(OnCharacterSelect, o, e, "Applejack");
            CharacterSelectGui.GetControl<Button>("character select PP button").MouseClick += (o, e) => Invoke(OnCharacterSelect, o, e, "Pinkie Pie");
            CharacterSelectGui.GetControl<Button>("character select FS button").MouseClick += (o, e) => Invoke(OnCharacterSelect, o, e, "Fluttershy");
            CharacterSelectGui.GetControl<Button>("character select rarity button").MouseClick += (o, e) => Invoke(OnCharacterSelect, o, e, "Rarity");
            CharacterSelectGui.GetControl<Button>("character select back button").MouseClick += (o, e) => Invoke(OnCharacterSelect_SelectBack, o, e);

            OptionsGui.GetControl<Button>("options ok button").MouseClick += (o, e) => Invoke(OnOptions_SelectOK, o, e);
        }
开发者ID:CisciarpMaster,项目名称:PonyKart,代码行数:59,代码来源:MainMenuManager.cs

示例4: LapCounterUIHandler

        public LapCounterUIHandler()
        {
            lapCountGUI = LKernel.Get<UIMain>().GetGUI("lap count gui");
            lapCountLabel = lapCountGUI.GetControl<Label>("lap count label");

            LapCounter.OnLap += new LapCounterEvent(OnLap);
            LevelManager.OnLevelPostLoad += new LevelEvent(OnPostLoad);
        }
开发者ID:CisciarpMaster,项目名称:PonyKart,代码行数:8,代码来源:LapCounterUIHandler.cs

示例5: CountdownUIHandler

        public CountdownUIHandler()
        {
            // set up our label
            countGui = LKernel.GetG<UIMain>().GetGUI("countdown gui");

            countLabel = countGui.GetControl<Label>("countdown label");

            // hook up to events
            RaceCountdown.OnCountdown += new RaceCountdownEvent(OnCountdown);
            LevelManager.OnLevelPreUnload += new LevelEvent(OnLevelPreUnload);
        }
开发者ID:CisciarpMaster,项目名称:PonyKart,代码行数:11,代码来源:CountdownUIHandler.cs

示例6: SetupLevelUI

        /// <summary>
        /// Make the level UI
        /// </summary>
        void SetupLevelUI()
        {
            this.levelGui = LKernel.GetG<UIMain>().GetGUI("level debug gui");

            // the button
            Button commandsButton = levelGui.GetControl<Button>("show/hide commands button");
            commandsButton.UserData = new UIUserData {
                ObstructsViewport = true,
            };
            #if !DEBUG
            commandsButton.Visible = false;
            #endif
            // subscribe to the events that change the current texture
            commandsButton.MouseDown += CommandsButton_MouseDown;

            // and the text that's toggled
            commandsLabel = levelGui.GetControl<Label>("commands label");
        }
开发者ID:CisciarpMaster,项目名称:PonyKart,代码行数:21,代码来源:LevelUIHandler.cs

示例7: Create

        /// <summary>
        /// I don't really need to have this in a separate method, but eh it doesn't matter
        /// </summary>
        void Create()
        {
            luaGui = LKernel.GetG<UIMain>().GetGUI("lua console gui");

            // make the panel
            panel = luaGui.GetControl<Panel>("lua console panel");
            panel.UserData = new UIUserData {
                ObstructsViewport = true,
            };

            // make the text box
            textBox = luaGui.GetControl<TextBox>("lua console text box");
            textBox.UserData = new UIUserData {
                ObstructsViewport = true,
            };

            // eeeeeeeeveeeeeeeeeents
            textBox.Submit += TextBoxSubmit;
        }
开发者ID:CisciarpMaster,项目名称:PonyKart,代码行数:22,代码来源:LuaConsoleManager.cs


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