Exemplo n.º 1
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);
            }
        }
Exemplo n.º 2
0
 public Control()
 {
     controls = new ObservableCollection<Control>();
     controls.CollectionChanged += Controls_CollectionChanged;
     needsLayout_ = true;
     Theme = new Theme();
 }