示例#1
0
 public bool Mouse_ButtonDown(object sender, MouseButtonEventArgs e)
 {
     focusedControl = baseControl.FindControlAtPoint(e.X, e.Y);
     if (focusedControl == null)
     {
         return false;
     }
     else
     {
         return focusedControl.Mouse_ButtonDown(sender, e);
     }
 }
示例#2
0
        public void OnInit(InitContext context)
        {
            if(context == InitContext.Activate)
            {
                Theme redBlue = new Theme();
                redBlue.ForegroundColour = ColorRgba.Red;
                redBlue.BackgroundColour = ColorRgba.Blue;

                Theme greenWhite = new Theme();
                greenWhite.ForegroundColour = ColorRgba.Green;
                greenWhite.BackgroundColour = ColorRgba.White;

                Window window = new Window();
                window.H = 100;
                window.W = 300;
                window.OffsetX = 20;
                window.OffsetY = 20;
                window.Theme = redBlue;

                TextBox text = new TextBox();
                text.Theme = greenWhite;
                text.H = 50;
                text.AnchorRight = new Anchor(10);
                text.AnchorLeft = new Anchor(10);
                text.AnchorTop = new Anchor(30);
                text.AnchorBottom = new Anchor(10);
                window.Controls.Add(text);

                this.baseControl = window;

                Magic_GameCorePlugin.Instance.AddInputProcessor(this);
            }
        }