/// <summary> /// Initializes a new instance of the <see cref="GamePlayMenuLabel"/> class. /// </summary> /// <param name="screen">The screen to be drawn on.</param> /// <param name="id">The id of this item.</param> /// <param name="graphicsDevice">The graphics device.</param> public GamePlayMenuLabel(GameScreen screen, int id, IBallerburgGraphicsManager graphicsDevice) { this.Id = id; this.Owner = screen; this.State = States.Visible; this.graphicsDevice = graphicsDevice; }
/// <summary> /// Initializes a new instance of the <see cref="GameObjectManager"/> class. /// </summary> /// <param name="contentManager">The content manager.</param> /// <param name="audioManager">The audio manager.</param> /// <param name="graphicsDevice">The graphics device.</param> public GameObjectManager(IContentManager contentManager, AudioManager audioManager, IBallerburgGraphicsManager graphicsDevice) { this.contentManager = contentManager; this.castles = new Castle[Gameplay.Constants.NumCastles]; this.audioManager = audioManager; this.graphicsDevice = graphicsDevice; }
/// <summary> /// Initializes a new instance of the <see cref="SoundScreen"/> class. /// </summary> /// <param name="graphicsManager">The graphics manager.</param> /// <param name="screenManager">The screen manager.</param> public SoundScreen(IBallerburgGraphicsManager graphicsManager, IScreenManager screenManager) : base(graphicsManager, screenManager, "Ballerburg3D") { // Zurück button zurueckMenuEntry = new MenuEntry(this, ResourceLoader.GetString("BackText"), 0) { Position = new Vector2(500, 450) }; zurueckMenuEntry.Selected += ZurueckMenuEntrySelected; musicVolumeSlider = new HSlider(this, new Rectangle(250, 100, 300, 20), screenManager.ApplicationSettings.MusicVolume); musicVolumeSlider.ValueChanged += OnMusicVolumeChanged; soundFxVolumeSlider = new HSlider(this, new Rectangle(250, 200, 300, 20), screenManager.ApplicationSettings.FxVolume); menuEffectsVolumeSlider = new HSlider(this, new Rectangle(250, 300, 300, 20), screenManager.ApplicationSettings.MenuEffectsVolume); var musicList = new List<string> { "DarkStar", "High Tension", "Tentacle", "Death Row", "Boomerang", "Aus" }; musicSelectButton = new ComboToggleButton(this, "Musik", new Collection<string>(musicList), 0, 0) { Position = new Vector2(20, 100) }; musicSelectButton.Selected += OnMusicButtonSelected; toggleMenuEffectsActionButton = new OnOffToggleButton(this, "Menueeffekte", true, 0) { Position = new Vector2(20, 200) }; toggleSoundEffectsActionButton = new OnOffToggleButton(this, "Soundeffekte", true, 0) { Position = new Vector2(20, 300) }; ControlsContainer.Add(zurueckMenuEntry); ControlsContainer.Add(musicVolumeSlider); ControlsContainer.Add(soundFxVolumeSlider); ControlsContainer.Add(menuEffectsVolumeSlider); ControlsContainer.Add(musicSelectButton); ControlsContainer.Add(toggleMenuEffectsActionButton); ControlsContainer.Add(toggleSoundEffectsActionButton); }
/// <summary> /// Initializes a new instance of the <see cref="GameScreen"/> class. /// </summary> /// <param name="graphicsManager">The graphics manager.</param> protected GameScreen(IBallerburgGraphicsManager graphicsManager) { this.graphicsManager = graphicsManager; controls = new Collection<Control>(); resourceLoader = new Windows.ApplicationModel.Resources.ResourceLoader(); ////Viewport viewport = this.GraphicsManager.GraphicsDevice.Viewport; }
/// <summary> /// Initializes a new instance of the <see cref="MenuScreen"/> class. /// </summary> /// <param name="graphicsManager">The graphics manager.</param> /// <param name="screenManager">The screen manager.</param> /// <param name="menuTitle">The menu title.</param> protected MenuScreen(IBallerburgGraphicsManager graphicsManager, IScreenManager screenManager, string menuTitle) : base(graphicsManager) { this.menuTitle = menuTitle; this.screenManager = screenManager; TransitionOnTime = TimeSpan.FromSeconds(0); TransitionOffTime = TimeSpan.FromSeconds(0); }
/// <summary> /// Initializes a new instance of the <see cref="GraphikScreen"/> class. /// </summary> /// <param name="graphicsManager">The graphics manager.</param> /// <param name="screenManager">The screen manager.</param> public GraphikScreen(IBallerburgGraphicsManager graphicsManager, IScreenManager screenManager) : base(graphicsManager, screenManager, "Ballerburg3D") { // Zurück button zurueckMenuEntry = new MenuEntry(this, ResourceLoader.GetString("BackText"), 0) { Position = new Vector2(500, 450) }; zurueckMenuEntry.Selected += ZurueckMenuEntrySelected; ControlsContainer.Add(zurueckMenuEntry); }
/// <summary> /// Initializes a new instance of the <see cref="TowerSettings"/> class. /// </summary> /// <param name="tower">The tower.</param> /// <param name="graphicsDevice">The graphics device.</param> public TowerSettings(Tower tower, IBallerburgGraphicsManager graphicsDevice) { this.X = tower.X; this.Y = tower.Y; this.Height = tower.Height; this.viewDirection = new Vector3(tower.X, tower.CoverHeight + 2, tower.Y + 1); this.ID = tower.ID; this.hasCannon = tower.HasCannon; if (this.hasCannon) { this.cannon = new Cannon(tower.X, tower.CoverHeight, tower.Y, null); this.cannon.InitGraphics(graphicsDevice.GraphicsDevice); } }
/// <summary> /// Initializes a new instance of the <see cref="StartScreen"/> class. /// </summary> /// <param name="graphicsManager">The graphics manager.</param> /// <param name="screenManager">The screen manager.</param> public StartScreen(IBallerburgGraphicsManager graphicsManager, IScreenManager screenManager) : base(graphicsManager, screenManager, "Ballerburg3D") { // Create our menu entries. spielStartenMenuEntry = new MenuEntry(this, "Spiel starten", 0) { Position = new Vector2(100, 150) }; spielerVerbindenMenuEntry = new MenuEntry(this, "Spieler verbinden", 1) { Position = new Vector2(100, 150 + 50) }; beendenMenuEntry = new MenuEntry(this, "Beenden", 2) { Position = new Vector2(100, 150 + 100) }; // Hook up menu event handlers. spielStartenMenuEntry.Selected += SpielStartenMenuEntrySelected; spielerVerbindenMenuEntry.Selected += SpielerVerbindenMenuEntrySelected; beendenMenuEntry.Selected += OnCancel; ControlsContainer.Add(spielStartenMenuEntry); ControlsContainer.Add(spielerVerbindenMenuEntry); ControlsContainer.Add(beendenMenuEntry); }
/// <summary> /// Initializes a new instance of the <see cref="MessageBoxScreen"/> class. /// </summary> /// <param name="graphicsManager">The graphics manager.</param> /// <param name="message">The message.</param> /// <param name="includeUsageText">if set to <c>true</c> [include usage text].</param> public MessageBoxScreen(IBallerburgGraphicsManager graphicsManager, string message, bool includeUsageText) : base(graphicsManager) { const string UsageText = "\nA button, Space, Enter = ok" + "\nB button, Esc = cancel"; if (includeUsageText) { this.message = message + UsageText; } else { this.message = message; } IsPopup = true; TransitionOffTime = TimeSpan.FromSeconds(0.2); }
/// <summary> /// Initializes a new instance of the <see cref="SpielartMessageBoxScreen"/> class. /// </summary> /// <param name="graphicManager">The graphic manager.</param> /// <param name="boxTitle">The box title.</param> public SpielartMessageBoxScreen(IBallerburgGraphicsManager graphicManager, string boxTitle) : base(graphicManager) { klassischMenuEntry = new MenuEntry(this, "Klassisch", 0) { Position = new Vector2(200, 200) }; klassischMenuEntry.Selected += KlassischMenuEntrySelected; arkadeMenuEntry = new MenuEntry(this, "Arkade", 1) { Position = new Vector2(200, 250) }; arkadeMenuEntry.Selected += ArkadeMenuEntrySelected; zurueckMenuEntry = new MenuEntry(this, ResourceLoader.GetString("BackText"), 1) { Position = new Vector2(360, 360) }; zurueckMenuEntry.Selected += ZurueckExitMessageBoxAccepted; ControlsContainer.Add(klassischMenuEntry); ControlsContainer.Add(arkadeMenuEntry); ControlsContainer.Add(zurueckMenuEntry); this.boxTitle = boxTitle; IsPopup = true; TransitionOffTime = TimeSpan.FromSeconds(0.2); }
/// <summary> /// Initializes a new instance of the <see cref="SpielBeendenMessageBoxScreen"/> class. /// </summary> /// <param name="graphicManager">The graphic manager.</param> /// <param name="boxTitle">The box title.</param> public SpielBeendenMessageBoxScreen(IBallerburgGraphicsManager graphicManager, string boxTitle) : base(graphicManager) { uebersichtMenuEntry = new MenuEntry(this, "Übersicht", 0) { Position = new Vector2(200, 200) }; uebersichtMenuEntry.Selected += UebersichtMenuEntrySelected; hauptmenuMenuEntry = new MenuEntry(this, "Hauptmenu", 1) { Position = new Vector2(200, 250) }; hauptmenuMenuEntry.Selected += HauptmenuMenuEntrySelected; beendenMenuEntry = new MenuEntry(this, "Beenden", 1) { Position = new Vector2(200, 300) }; beendenMenuEntry.Selected += BeendenMenuEntrySelected; ControlsContainer.Add(uebersichtMenuEntry); ControlsContainer.Add(hauptmenuMenuEntry); ControlsContainer.Add(beendenMenuEntry); this.boxTitle = boxTitle; IsPopup = true; TransitionOffTime = TimeSpan.FromSeconds(0.2); }
/// <summary> /// Initializes a new instance of the <see cref="ScreenManager"/> class. /// </summary> /// <param name="graphicsManager">The graphics manager.</param> /// <param name="contentManager">The content manager.</param> /// <param name="gameObjectManager">The game object manager.</param> /// <param name="settings">The settings.</param> /// <param name="gameSettings">The game settings.</param> /// <param name="shaderManager">The shader manager.</param> /// <param name="audioManager">The audio manager.</param> /// <param name="playerSettings">The player settings.</param> public ScreenManager( IBallerburgGraphicsManager graphicsManager, IContentManager contentManager, IGameObjectManager gameObjectManager, ApplicationSettings settings, IGameSettingsManager gameSettings, IShaderManager shaderManager, AudioManager audioManager, PlayerSettings[] playerSettings) { // Load content belonging to the screen manager. this.graphicsManager = graphicsManager; this.contentManager = contentManager; this.gameObjectManager = gameObjectManager; this.GameSettings = gameSettings; this.shaderManager = shaderManager; this.audioManager = audioManager; this.playerSettings = playerSettings; applicationSettings = settings; isInitialized = true; }
/// <summary> /// Initializes a new instance of the <see cref="YesNoMessageBoxScreen"/> class. /// </summary> /// <param name="graphicsManager">The graphics manager.</param> /// <param name="boxTitle">The box title.</param> /// <param name="message">The message.</param> public YesNoMessageBoxScreen(IBallerburgGraphicsManager graphicsManager, string boxTitle, string message) : base(graphicsManager) { jaMenuEntry = new MenuEntry(this, ResourceLoader.GetString("YesText"), 0) { Position = new Vector2(320, 360) }; jaMenuEntry.Selected += ConfirmExitMessageBoxAccepted; neinMenuEntry = new MenuEntry(this, ResourceLoader.GetString("NoText"), 1) { Position = new Vector2(380, 360) }; neinMenuEntry.Selected += CancelExitMessageBoxAccepted; ControlsContainer.Add(jaMenuEntry); ControlsContainer.Add(neinMenuEntry); this.boxTitle = boxTitle; this.message = message; IsPopup = true; selectedEntry = -1; TransitionOffTime = TimeSpan.FromSeconds(0.2); }
/// <summary> /// Initializes a new instance of the <see cref="SpielerDialogScreen"/> class. /// </summary> /// <param name="graphicsManager">The GraphicsManager</param> /// <param name="screenManager">The screen manager.</param> /// <param name="spielerNr">The spieler nr.</param> /// <param name="playerSettings">The player settings.</param> public SpielerDialogScreen(IBallerburgGraphicsManager graphicsManager, IScreenManager screenManager, int spielerNr, PlayerSettings playerSettings) : base(graphicsManager, screenManager, "Spieler" + spielerNr.ToString() + " Dialog") { this.playerSettings = playerSettings; // Zurück button zurueckMenuEntry = new MenuEntry(this, ResourceLoader.GetString("BackText"), 0) { Position = new Vector2(500, 450) }; zurueckMenuEntry.Selected += ZurueckMenuEntrySelected; castleType = screenManager.PlayerSettings[spielerNr - 1].Castle.CastleType; var selectedEntry = 0; if (screenManager.PlayerSettings[spielerNr - 1].PlayerType == PlayerType.Computer) { selectedEntry = 1; } var entries = new List<string> { "Aus", "An" }; computerMenuEntry = new ComboToggleButton(this, "Computer", new Collection<string>(entries), selectedEntry, 0) { Position = new Vector2(10, 100) }; computerMenuEntry.Selected += ComputerMenuEntrySelected; txtCastleName = new TextBox(this, false) { Position = new Vector2(260, 270), ShowCursor = false }; nameLabel = new MenuEntry(this, "Name", 0) { Position = new Vector2(10, 200) }; nameLabel.Selected += NameMenuEntrySelected; ControlsContainer.Add(zurueckMenuEntry); ControlsContainer.Add(computerMenuEntry); ControlsContainer.Add(nameLabel); ControlsContainer.Add(txtCastleName); var pp = GraphicsManager.GraphicsDevice.PresentationParameters; renderTarget = new RenderTarget2D(GraphicsManager.GraphicsDevice, pp.BackBufferWidth, pp.BackBufferHeight, false, SurfaceFormat.Color, DepthFormat.Depth24Stencil8); }
public EnterNameDialogScreen(IBallerburgGraphicsManager graphicManager, string boxTitle, PlayerSettings playerSettings) : base(graphicManager) { this.playerSettings = playerSettings; zurueckMenuEntry = new MenuEntry(this, ResourceLoader.GetString("BackText"), 1) { Position = new Vector2(360, 360) }; zurueckMenuEntry.Selected += ZurueckExitMessageBoxAccepted; textBox = new TextBox(this, true) { Position = new Vector2(200, 250), Text = playerSettings.PlayerName, ShowCursor = true }; textBox.SetFocus(); ControlsContainer.Add(zurueckMenuEntry); ControlsContainer.Add(textBox); this.boxTitle = boxTitle; IsPopup = true; TransitionOffTime = TimeSpan.FromSeconds(0.2); }
/// <summary> /// Initializes a new instance of the <see cref="Terrain"/> class. /// </summary> /// <param name="contentManager">The content manager.</param> /// <param name="graphicsDevice">The graphics device.</param> public Terrain(IContentManager contentManager, IBallerburgGraphicsManager graphicsDevice) { this.texture = contentManager.TerrainTexture; this.InitTerrainGraphics(graphicsDevice); }
/// <summary> /// Initializes a new instance of the <see cref="Camera"/> class. /// </summary> /// <param name="graphicsManager">The graphics manager.</param> public Camera(IBallerburgGraphicsManager graphicsManager) { this.graphicsManager = graphicsManager; viewPort = graphicsManager.GraphicsDevice.Viewport; }
/// <summary> /// Loads the content. /// </summary> /// <param name="xnaContent">Content of the xna.</param> /// <param name="graphicsManager">The graphics manager.</param> public void LoadContent(XnaContentManager xnaContent, IBallerburgGraphicsManager graphicsManager) { if (null != this.content) { return; } content = xnaContent; content.RootDirectory = "Content"; MenuFont = this.content.Load<SpriteFont>("menufont"); DebugColorTexture = this.content.Load<Texture2D>("solidred"); BackgroundTexture = this.content.Load<Texture2D>("Pic2"); MenuTexture = this.content.Load<Texture2D>("Pic4"); GameFont = this.content.Load<SpriteFont>("gamefont"); SkyBox = this.content.Load<SkyBox>(@"Skybox\SkyBox"); GradientTexture = this.content.Load<Texture2D>("Pic3"); MousePointerTexture = this.content.Load<Texture2D>(@"Arrow3"); Castle1 = this.content.Load<Castle>(@"Castles\Castle1"); Castle1.Initialize(graphicsManager.GraphicsDevice); Castle2 = this.content.Load<Castle>(@"Castles\Castle2"); Castle2.Initialize(graphicsManager.GraphicsDevice); Castle3 = this.content.Load<Castle>(@"Castles\Castle3"); Castle3.Initialize(graphicsManager.GraphicsDevice); Castle4 = this.content.Load<Castle>(@"Castles\Castle4"); Castle4.Initialize(graphicsManager.GraphicsDevice); Castle5 = this.content.Load<Castle>(@"Castles\Castle5"); Castle5.Initialize(graphicsManager.GraphicsDevice); Castle6 = this.content.Load<Castle>(@"Castles\Castle6"); Castle6.Initialize(graphicsManager.GraphicsDevice); Castle7 = this.content.Load<Castle>(@"Castles\Castle7"); Castle7.Initialize(graphicsManager.GraphicsDevice); Castle8 = this.content.Load<Castle>(@"Castles\Castle8"); Castle8.Initialize(graphicsManager.GraphicsDevice); ExplosionFrame01 = this.content.Load<Texture2D>(@"Explosion\Explosion_Frame01"); ExplosionFrame02 = this.content.Load<Texture2D>(@"Explosion\Explosion_Frame02"); ExplosionFrame03 = this.content.Load<Texture2D>(@"Explosion\Explosion_Frame03"); ExplosionFrame04 = this.content.Load<Texture2D>(@"Explosion\Explosion_Frame04"); ExplosionFrame05 = this.content.Load<Texture2D>(@"Explosion\Explosion_Frame05"); ExplosionFrame06 = this.content.Load<Texture2D>(@"Explosion\Explosion_Frame06"); ExplosionFrame07 = this.content.Load<Texture2D>(@"Explosion\Explosion_Frame07"); ExplosionFrame08 = this.content.Load<Texture2D>(@"Explosion\Explosion_Frame08"); CannonTexture = this.content.Load<Texture2D>("Tex8"); KugelMesh = this.content.Load<Model>("SphereNew"); BlankTexture = this.content.Load<Texture2D>("blank"); WhiteTexture = this.content.Load<Texture2D>("WhiteRect"); TerrainTexture = this.content.Load<Texture2D>("Tex1"); CursorTexture = this.content.Load<Texture2D>(@"GUI\cursor"); CannonBallTexture = this.content.Load<Texture2D>(@"SphereFinal"); BackgroundMusicTracks = new Dictionary<string, Song>(); BackgroundMusicTracks.Add("Darkstar", content.Load<Song>(@"Audio\Music1")); BackgroundMusicTracks.Add("HighTension", content.Load<Song>(@"Audio\Music2")); BackgroundMusicTracks.Add("Tentacle", content.Load<Song>(@"Audio\Music3")); BackgroundMusicTracks.Add("DeathRow", content.Load<Song>(@"Audio\Music4")); BackgroundMusicTracks.Add("Boomerang", content.Load<Song>(@"Audio\Music5")); }
/// <summary> /// Initializes a new instance of the <see cref="BackgroundScreen"/> class. /// </summary> /// <param name="graphicsManager">The graphics manager.</param> public BackgroundScreen(IBallerburgGraphicsManager graphicsManager) : base(graphicsManager) { TransitionOnTime = TimeSpan.FromSeconds(0); TransitionOffTime = TimeSpan.FromSeconds(0); }
/// <summary> /// Initializes a new instance of the <see cref="EinstellungenScreen"/> class. /// </summary> /// <param name="graphicsManager">The graphics manager.</param> /// <param name="screenManager">The screen manager.</param> /// <param name="currentPlayerId">The current player ID.</param> public EinstellungenScreen(IBallerburgGraphicsManager graphicsManager, IScreenManager screenManager, int currentPlayerId) : base(graphicsManager, screenManager, "Ballerburg3D") { playerId = currentPlayerId; lblInventar = new GamePlayMenuLabel(this, 0, graphicsManager) { Text = string.Format("{0}:", ResourceLoader.GetString("InventoryText")), Position = new Vector2(20, 70) }; lblBevoelkerung = new GamePlayMenuLabel(this, 0, graphicsManager) { Text = "Bevölkerung:", Position = new Vector2(20, 170) }; lblVerzinsung = new GamePlayMenuLabel(this, 0, graphicsManager) { Text = "Verzinsung:", Position = new Vector2(20, 220) }; lblKaufen = new GamePlayMenuLabel(this, 0, graphicsManager) { Text = "Kaufen:", Position = new Vector2(20, 310) }; // Inventar lblMoney = new GamePlayMenuLabel(this, 0, graphicsManager) { Text = screenManager.PlayerSettings[playerId].Money.ToString(CultureInfo.InvariantCulture) + " $", Position = new Vector2(220, 70) }; lblCannons = new GamePlayMenuLabel(this, 0, graphicsManager) { Text = screenManager.PlayerSettings[playerId].NumCannons() + " Kanonen", Position = new Vector2(420, 70) }; lblStone = new GamePlayMenuLabel(this, 0, graphicsManager) { Text = screenManager.PlayerSettings[playerId].Steinkugel.ToString(CultureInfo.InvariantCulture) + " Steinkugeln", Position = new Vector2(220, 120) }; lblIron = new GamePlayMenuLabel(this, 0, graphicsManager) { Text = screenManager.PlayerSettings[playerId].Eisenkugeln.ToString(CultureInfo.InvariantCulture) + " Eisenkugeln", Position = new Vector2(420, 120) }; // Bevölkerung lblNumBevoelkerung = new GamePlayMenuLabel(this, 0, graphicsManager) { Text = screenManager.PlayerSettings[playerId].Population.ToString(CultureInfo.InvariantCulture) + " Leute", Position = new Vector2(220, 170) }; // Verzinsing sldVerzinsung = new HSlider(this, new Rectangle(220, 240, 300, 20), screenManager.PlayerSettings[playerId].Verzinsung); sldVerzinsung.ValueChanged += OnVerzinsungChanged; sldVerzinsung.MaxValue = 100; sldVerzinsung.MinValue = 0; sldVerzinsung.Value = screenManager.PlayerSettings[playerId].Verzinsung; lblZinssatz = new GamePlayMenuLabel(this, 0, graphicsManager) { Text = string.Format("{0}%", screenManager.PlayerSettings[playerId].Verzinsung), Position = new Vector2(340, 260) }; // Kaufbuttons atbCannon = new ActionToggleButton(this, ResourceLoader.GetString("CannonText"), "4000$", 0) { Position = new Vector2(220, 310) }; atbCannon.Selected += delegate { screenManager.AudioManager.PlayKlickSound(); screenManager.PlayerSettings[playerId].Money -= 4000; screenManager.PlayerSettings[playerId].AddCannon(); }; atbPulver = new ActionToggleButton(this, ResourceLoader.GetString("PowderBuyText"), "1000$", 0) { Position = new Vector2(420, 310) }; atbPulver.Selected += delegate { screenManager.AudioManager.PlayKlickSound(); screenManager.PlayerSettings[playerId].Money -= 1000; screenManager.PlayerSettings[playerId].AddPowder(); }; atbEisenkugel = new ActionToggleButton(this, ResourceLoader.GetString("IronBallText"), "1000$", 0) { Position = new Vector2(420, 360) }; atbEisenkugel.Selected += delegate { screenManager.AudioManager.PlayKlickSound(); screenManager.PlayerSettings[playerId].Money -= 1000; screenManager.PlayerSettings[playerId].AddIronBall(); }; atbSteinkugel = new ActionToggleButton(this, ResourceLoader.GetString("StoneBallText"), "250$", 0) { Position = new Vector2(220, 360) }; atbSteinkugel.Selected += delegate { screenManager.AudioManager.PlayKlickSound(); screenManager.PlayerSettings[playerId].Money -= 250; screenManager.PlayerSettings[playerId].AddStoneBall(); }; // Weiter button weiterMenuEntry = new MenuEntry(this, "Weiter", 0) { Position = new Vector2(350, 450) }; weiterMenuEntry.Selected += WeiterMenuEntrySelected; // Beenden button beendenMenuEntry = new MenuEntry(this, "Beenden", 0) { Position = new Vector2(500, 450) }; beendenMenuEntry.Selected += BeendenMenuEntrySelected; ControlsContainer.Add(weiterMenuEntry); ControlsContainer.Add(beendenMenuEntry); ControlsContainer.Add(lblInventar); ControlsContainer.Add(lblMoney); ControlsContainer.Add(lblCannons); ControlsContainer.Add(lblBevoelkerung); ControlsContainer.Add(lblNumBevoelkerung); ControlsContainer.Add(lblVerzinsung); ControlsContainer.Add(lblKaufen); ControlsContainer.Add(lblStone); ControlsContainer.Add(lblIron); ControlsContainer.Add(atbCannon); ControlsContainer.Add(atbEisenkugel); ControlsContainer.Add(atbPulver); ControlsContainer.Add(atbSteinkugel); ControlsContainer.Add(sldVerzinsung); ControlsContainer.Add(lblZinssatz); }
/// <summary> /// Initializes a new instance of the <see cref="MainMenuScreen"/> class. /// </summary> /// <param name="graphicsManager">The graphics manager.</param> /// <param name="screenManager">The screen manager.</param> public MainMenuScreen(IBallerburgGraphicsManager graphicsManager, IScreenManager screenManager) : base(graphicsManager, screenManager, "Ballerburg3D") { // Create the menu entries. // Starten Button spielStartenMenuEntry = new MenuEntry(this, "starten", 0) { Position = new Vector2(350, 450) }; spielStartenMenuEntry.Selected += SpielStartenMenuEntrySelected; // Zurück button zurueckMenuEntry = new MenuEntry(this, ResourceLoader.GetString("BackText"), 0) { Position = new Vector2(500, 450) }; zurueckMenuEntry.Selected += ZurueckMenuEntrySelected; // Anzahl Spieler Buttons var numPlayerList = new List<string> { "Anzahl: 2", "Anzahl: 3", "Anzahl: 4" }; anzahlSpielerToggleButton = new ComboToggleButton(this, "Spieler", new Collection<string>(numPlayerList), 0, 0) { Position = new Vector2(10, 100) }; anzahlSpielerToggleButton.Selected += ToggleNumPlayersMenuEntrySelected; spielOptionenMenuEntry = new MenuEntry(this, "Optionen", 0) { Position = new Vector2(10, 250) }; spielOptionenMenuEntry.Selected += SpielOptionenMenuEntrySelected; soundMenuEntry = new MenuEntry(this, "Sound", 0) { Position = new Vector2(220, 250) }; soundMenuEntry.Selected += SoundMenuEntrySelected; creditsMenuEntry = new MenuEntry(this, "Credits", 0) { Position = new Vector2(430, 250) }; creditsMenuEntry.Selected += CreditsMenuEntrySelected; graphikMenuEntry = new MenuEntry(this, "Graphik", 0) { Position = new Vector2(220, 350) }; graphikMenuEntry.Selected += GraphikMenuEntrySelected; spielerActionButtons = new ActionToggleButton[4]; spielerActionButtons[0] = new ActionToggleButton(this, "Spieler 1", screenManager.PlayerSettings[0].PlayerName, 0) { Position = new Vector2(220, 100) }; spielerActionButtons[0].Selected += Spieler1KonfigurierenMenuEntrySelected; screenManager.PlayerSettings[0].IsActive = true; spielerActionButtons[1] = new ActionToggleButton(this, "Spieler 2", screenManager.PlayerSettings[1].PlayerName, 0) { Position = new Vector2(430, 100) }; spielerActionButtons[1].Selected += Spieler2KonfigurierenMenuEntrySelected; screenManager.PlayerSettings[1].IsActive = true; spielerActionButtons[2] = new ActionToggleButton(this, "Spieler 3", screenManager.PlayerSettings[2].PlayerName, 0) { Position = new Vector2(220, 150) }; spielerActionButtons[2].Selected += Spieler3KonfigurierenMenuEntrySelected; spielerActionButtons[2].SetInactive(); screenManager.PlayerSettings[2].IsActive = false; spielerActionButtons[3] = new ActionToggleButton(this, "Spieler 4", screenManager.PlayerSettings[3].PlayerName, 0) { Position = new Vector2(430, 150) }; spielerActionButtons[3].Selected += Spieler4KonfigurierenMenuEntrySelected; spielerActionButtons[3].SetInactive(); screenManager.PlayerSettings[3].IsActive = false; for (int i = 0; i < GameSettings.NumPlayers; i++) { spielerActionButtons[i].SetActive(); } for (int i = GameSettings.NumPlayers; i < 4; i++) { spielerActionButtons[i].SetInactive(); } ControlsContainer.Add(spielStartenMenuEntry); ControlsContainer.Add(zurueckMenuEntry); ControlsContainer.Add(anzahlSpielerToggleButton); ControlsContainer.Add(spielerActionButtons[0]); ControlsContainer.Add(spielerActionButtons[1]); ControlsContainer.Add(spielerActionButtons[2]); ControlsContainer.Add(spielerActionButtons[3]); ControlsContainer.Add(spielOptionenMenuEntry); ControlsContainer.Add(soundMenuEntry); ControlsContainer.Add(creditsMenuEntry); ControlsContainer.Add(graphikMenuEntry); ScreenActivated += OnScreenActivated; }
/// <summary> /// Inits the terrain graphics. /// </summary> /// <param name="graphicsDevice">The graphics device.</param> private void InitTerrainGraphics(IBallerburgGraphicsManager graphicsDevice) { this.vertices = new VertexPositionNormalTexture[6]; // Untere Seite (Kamera schaut entlang der negativen Y-Achse) this.vertices[0].Position = new Vector3(-1000.0f, 0.0f, -1000.0f); this.vertices[0].TextureCoordinate = new Vector2(0.0f, 100.0f); this.vertices[0].Normal = new Vector3(0.0f, 1.0f, 0.0f); this.vertices[1].Position = new Vector3(-1000.0f, 0.0f, 1000.0f); this.vertices[1].TextureCoordinate = new Vector2(0.0f, 0.0f); this.vertices[1].Normal = new Vector3(0.0f, 1.0f, 0.0f); this.vertices[2].Position = new Vector3(1000.0f, 0.0f, -1000.0f); this.vertices[2].TextureCoordinate = new Vector2(100.0f, 100.0f); this.vertices[2].Normal = new Vector3(0.0f, 1.0f, 0.0f); this.vertices[3].Position = new Vector3(-1000.0f, 0.0f, 1000.0f); this.vertices[3].TextureCoordinate = new Vector2(0.0f, 0.0f); this.vertices[3].Normal = new Vector3(0.0f, 1.0f, 0.0f); this.vertices[4].Position = new Vector3(1000.0f, 0.0f, 1000.0f); this.vertices[4].TextureCoordinate = new Vector2(100.0f, 0.0f); this.vertices[4].Normal = new Vector3(0.0f, 1.0f, 0.0f); this.vertices[5].Position = new Vector3(1000.0f, 0.0f, -1000.0f); this.vertices[5].TextureCoordinate = new Vector2(100.0f, 100.0f); this.vertices[5].Normal = new Vector3(0.0f, 1.0f, 0.0f); this.vertexBuffer = new VertexBuffer(graphicsDevice.GraphicsDevice, typeof(VertexPositionNormalTexture), this.vertices.Length, BufferUsage.None); this.vertexBuffer.SetData(this.vertices); ////this.texture = BallerburgGame.ContentManager.TerrainTexture; }
/// <summary> /// Initializes a new instance of the <see cref="MessageBoxScreen"/> class. /// </summary> /// <param name="graphicsManager">The graphics manager.</param> /// <param name="message">The message.</param> public MessageBoxScreen(IBallerburgGraphicsManager graphicsManager, string message) : this(graphicsManager, message, true) { }