Example #1
0
    public GameWindow() : base(Gtk.WindowType.Toplevel)
    {
        BorderWidth = 8;

        var monitor = Screen.GetMonitorGeometry(Screen.GetMonitorAtWindow(GdkWindow));

        _absolute_size = (int)(Math.Round(Math.Min(monitor.Width, monitor.Height) / 200.0)) * 100;
        _size          = (int)(Math.Round(Math.Min(Screen.Width, Screen.Height) / 200.0)) * 100;

        _area = new Drawing.GameArea(_size, _size);

        Add(_area);
        Title = "DIKUArcade";
        Drawing.Scaler.InitScale(_area.Pixmap);

        SetSizeRequest(_size, _size);
        _area.SetSizeRequest(_absolute_size, _absolute_size);

        WindowPosition = WindowPosition.Center;

        KeyPressEvent += KeyPressEventHandler;
        DeleteEvent   += OnDeleteEvent;

        _timerDelegate = new System.Threading.TimerCallback(TimerCallback);
        DrawTimer      = new Timer(_timerDelegate, this, 0, 100);
        // set timer to 200 ms (8-bit style)
    }
Example #2
0
 public override void OnDrawScene(Drawing.GameArea area)
 {
     if (_SpaceBackground != null)
     {
         _win.Area.Pixmap.DrawImage(_SpaceBackground);
     }
     this.DrawLabelCentered(_pickGameLabel, 50);
 }
Example #3
0
 public GameFactory(Drawing.GameArea area)
 {
     _area = area;
 }
Example #4
0
 public SpaceTaxiFactory(Drawing.GameArea area) : base(area)
 {
 }
Example #5
0
 public GalagaGameFactory(Drawing.GameArea area)
     : base(area)
 {
     // All the work is done in the base-class constructor.
 }