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


C# Menu.SetSize方法代码示例

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


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

示例1: OnButtonPressed

        /// <summary>
        /// Color-select button press handler.
        /// </summary>
        /// <param name="control">Event source.</param>
		protected virtual void OnButtonPressed(Control.Base control, EventArgs args)
        {
            Menu menu = new Menu(GetCanvas());
            menu.SetSize(256, 180);
            menu.DeleteOnClose = true;
            menu.IconMarginDisabled = true;

            HSVColorPicker picker = new HSVColorPicker(menu);
            picker.Dock = Pos.Fill;
            picker.SetSize(256, 128);

            string[] split = m_TextBox.Text.Split(' ');

            picker.SetColor(GetColorFromText(), false, true);
            picker.ColorChanged += OnColorChanged;

            menu.Open(Pos.Right | Pos.Top);
        }
开发者ID:LawlietRyuuzaki,项目名称:gwen-dotnet,代码行数:22,代码来源:Color.cs

示例2: Initialize

            /// <summary>
            /// Allows the game to perform any initialization it needs to before starting to run.
            /// This is where it can query for any required services and load any non-graphic
            /// related content.  Calling base.Initialize will enumerate through any components
            /// and initialize them as well.
            /// </summary>
            protected override void Initialize()
            {
                Components.Add(new GamerServicesComponent(this));
                Sprites = new SpriteBatch(Graphics.GraphicsDevice);
                Primitives.Initialize();
                Viewport = Graphics.GraphicsDevice.Viewport;

                sizex = Viewport.Width;
                sizey = Viewport.Height;

                splash = new Screen(sizex, sizey);
                mainscreen = new Screen(sizex, sizey);

                menu = new Menu(3);
                difficulty = new Menu(3);
                yesno = new Menu(2);
                okay = new Menu(1);

                splash.Initialize();
                mainscreen.Initialize();

                Input.Initialize();
                FontEngine.Initialize(64, 16, 32);

                menu.Initialize();
                difficulty.Initialize();
                yesno.Initialize();
                okay.Initialize();

                menu.SetSpacing(10);
                menu.SetSize(347, 97);
                menu.SetText(0, "Start");
                menu.SetText(1, "Level");
                menu.SetText(2, "Quit");

                difficulty.SetSpacing(10);
                difficulty.SetSize(347, 97);
                difficulty.SetText(0, "Easy");
                difficulty.SetText(1, "Medium");
                difficulty.SetText(2, "Hard");

                yesno.SetSpacing(8);
                yesno.SetSize(247, 47);
                yesno.SetText(0, "Yes");
                yesno.SetText(1, "No");

                okay.SetSpacing(8);
                okay.SetSize(247, 47);
                okay.SetText(0, "OK");

                cancel.Iniitialize();
                cancel.text = "Quit game?";
                cancel.SetSize(32 * cancel.text.Length, 48);

                replay.Iniitialize();
                replay.text = "Play again?";
                replay.SetSize(32 * replay.text.Length, 48);

                winner.Iniitialize();
                winner.text = "Winner!";
                winner.SetSize(48 * winner.text.Length, 64);

                score.Iniitialize();
                score.text = "Score: ";
                score.SetSize(48 * score.text.Length, 64);

                box.Initialize();
                box.SetSize(304);
                box.SetPosition(398, 88);

                laser.Initialize();

                hud.Initialize();
                hud.SetSize(175, 350);
                hud.SetPosition(145, 65);

                gametime = 0;

                base.Initialize();
            }
开发者ID:spdemille,项目名称:Baffled,代码行数:86,代码来源:Baffled.cs


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