public MainForm() { Name = "TimeCollapse"; ClientSize = Screen.PrimaryScreen.Bounds.Size; StartPosition = FormStartPosition.CenterScreen; WindowState = FormWindowState.Maximized; FormBorderStyle = FormBorderStyle.None; SuspendLayout(); menu = new MenuControl(this) { Enabled = true }; menu.Show(); menu.Focus(); game = new GameControl(this) { Enabled = false }; game.Hide(); constructor = new MapConstructor(this) { Enabled = false }; constructor.Hide(); Controls.AddRange(new Control[] { menu, game, constructor }); ResumeLayout(false); new SoundPlayer(@"Audio\Ambient.wav").PlayLooping(); }
public MapConstructorCanvas(MapConstructor mapConstructor) { this.mapConstructor = mapConstructor; var res = Screen.PrimaryScreen.Bounds.Size; sx = res.Width / 1920f; sy = res.Height / 1080f; BackgroundImage = BackGroundDots(); mapConstructor.Stages.SelectedIndexChanged += (sender, args) => Invalidate(); SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint, true); UpdateStyles(); }