Ejemplo n.º 1
0
 protected virtual void initialize()
 {
     texture    = Global.Content.Load <Texture2D>(@"Graphics/Windowskins/Message_Window");
     Src_Rect   = new Rectangle(0, 0, 0, 0);
     offset     = new Vector2(-8, 3);
     Background = new Text_Box(48, 32);
     loc        = new Vector2(48, 48);
 }
 protected override void initialize()
 {
     texture            = Global.Content.Load <Texture2D>(@"Graphics/Windowskins/Message_Window");
     Src_Rect           = new Rectangle(0, 0, 0, 0);
     Background         = new Text_Box(48, 32);
     Background.texture = Global.Content.Load <Texture2D>(@"Graphics/Windowskins/Preparations_Item_Options_Window");
     loc = new Vector2(48, 48);
 }
Ejemplo n.º 3
0
 void TextBoxKeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == (char)Keys.Enter)
     {
         if (Text_Box.Text != "")
         {
             if (int.Parse(Text_Box.Text) >= 3)
             {
                 t.size = int.Parse(Text_Box.Text);
                 if (t.size > 5)
                 {
                     t.winscore = 5;
                 }
                 else
                 {
                     t.winscore = t.size;
                 }
                 t.board = new Square [t.size, t.size];
                 Controls.Remove(Text_Box);
                 ChoosingLevel();
             }
             else
             {
                 MessageBox.Show("Wrong size");
             }
             Text_Box.Clear();
         }
     }
     else if ((e.KeyChar == 8) && (Text_Box.Text.Length > 0))
     {
         Text_Box.Text = Text_Box.Text.Substring(0, Text_Box.Text.Length - 1);
     }
     else if (!(e.KeyChar >= 48 && e.KeyChar <= 57))
     {
         e.Handled = true;
         MessageBox.Show("Incorrect character");
     }
 }