本文整理汇总了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);
}
示例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();
}