Пример #1
0
			public HowToPlaySubMenu(MainMenu parent, Theme backTheme)
			{
				this.parent = parent;
				this.backTheme = backTheme;
				Add(new Sprite(new Material(ShaderFlags.Position2DColoredTextured, "BreakoutLogo"),
					Rectangle.FromCenter(0.5f, ScreenSpace.Current.Viewport.Top + 0.2f, 0.7f, 0.3f)));
				SetViewportBackground("Background");
				AddControlDescription();
				AddBackButton();
			}
Пример #2
0
		public Game(Window window)
		{
			screenSpace = new Camera2DScreenSpace(window);
			this.window = window;
			menu = new MainMenu();
			menu.InitGame += InitGame;
			menu.QuitGame += window.CloseAfterFrame;
			window.ViewportPixelSize = Settings.Current.Resolution;
			soundTrack = ContentLoader.Load<Music>("BreakoutMusic");
			soundTrack.Loop = true;
			soundTrack.Play();
			MainMenu.SettingsChanged += UpdateMusicVolume;
			screenSpace.Zoom = 1 / window.ViewportPixelSize.AspectRatio;
			window.ViewportSizeChanged += SizeChanged;
			SetViewportBackground("Background");
		}
Пример #3
0
			public OptionSubmenu(MainMenu parent, Theme menuTheme)
			{
				this.parent = parent;
				this.menuTheme = menuTheme;
				SetViewportBackground("Background");
				Add(new Sprite(new Material(ShaderFlags.Position2DColoredTextured, "BreakoutLogo"),
					Rectangle.FromCenter(0.5f, ScreenSpace.Current.Viewport.Top + 0.2f, 0.7f, 0.3f)));
				AddMusicOption();
				AddSoundOption();
				AddBackButton();
			}