public SimControl(Size size, SimWindow simwindow) { this.simwindow = simwindow; simulationMap = new SimulationMap(this); //methode in the partial class creating all the objects needed for the simulation this.Size = new Size(2000, 1500); //has to be changed to the windowsize Point bitmapLocation = new Point(-((this.Size.Width - Screen.PrimaryScreen.Bounds.Width) / 2), -((this.Size.Height - Screen.PrimaryScreen.Bounds.Height) / 2)); this.Location = bitmapLocation; this.BackColor = Color.Green; /* * De bitmapControls in which the simulation takes place, all the bitmapcontrols have a bitmap with * which it interacts. Use the BitmapControl to change the bitmaps used for the simulation */ backgroundBC = new BitmapControl(this.Size); trafficlightBC = new BitmapControl(this.Size); vehicleBC = new BitmapControl(this.Size); totalCars = 0; // isMoved = false; // mouseDownPoint = new Point(0, 0); mouseMovePoint = new Point(0, 0); //amount of tiles that fit in the bitmap horizontally tilesHorizontal = Size.Width / 100; this.Visible = true; gameSpeed = 1; this.simulation = new Simulation(this); InitializeComponent(); //The simulation thread will be started here, the whole simulation will be regulated in this class. this.simulation = new Simulation(this); vehicleBC.AddGrid(); }
public EfficientieWindow(SimWindow sim) { this.simwindow = sim; InitializeComponent(); button1.Enabled = false; button3.Enabled = false; button2.Tag = "paused"; timerStarted = false; label3.Text = ""; }
public StartControl(Size size, SimWindow sim) { InterfaceStart StartScherm = new InterfaceStart(this); this.Size = size; simwindow = sim; StartHost = new ElementHost() { Location = new Point(((size.Width-300)/2), ((size.Height -300)/2)), Height = 300, Width = 300, BackColor = Color.Green, Child = StartScherm }; this.Controls.Add(StartHost); }
public WindowSelect() { int widthStartScreen, heightStartScreen; // Scherm maximaliseren this.WindowState = FormWindowState.Maximized; // Alle schermranden weghalen this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; //Schermgroote bepalen using (Graphics graphics = this.CreateGraphics()) { widthStartScreen = Screen.PrimaryScreen.Bounds.Width; heightStartScreen = Screen.PrimaryScreen.Bounds.Height ; } screensize = new Size(widthStartScreen, heightStartScreen); simwindow = new SimWindow(screensize, this); startwindow = new StartWindow(screensize, this); Start(); }