Example #1
0
        public UIDemoProgram()
        {
            this.graphics = new VirtualGraphics(this, this.CreateGraphics());

            this.ui       = new UserInterface();
            this.ui.Skin  = Skin.Load(this, "skin.sml");
            this.ui.Input = new WindowsFormsInput(this);

            var form = Form.Load("userinterface.sml", this);

            form.ViewModel = new GameViewModel();

            this.ui.CurrentForm = form;

            var timer = new Timer()
            {
                Interval = 25
            };

            timer.Tick += (s, e) => { this.ui.Update(this.graphics); this.Invalidate(); };
            timer.Start();

            this.DoubleBuffered = true;
            this.ClientSize     = new System.Drawing.Size(800, 600);
        }
Example #2
0
 protected override void OnPaint(PaintEventArgs e)
 {
     this.graphics.graphics = e.Graphics;
     this.ui.Draw(this.graphics);
 }