public override void Draw(SpriteBatchProxy spriteBatch) { ParticuleManager.Draw(true); spriteBatch.BeginNoCamera(); spriteBatch.Draw(Application.MagicContentManager.GetTexture("splash1"), new Rectangle(0, 0, Resolution.VirtualWidth, Resolution.VirtualHeight), Color.White); spriteBatch.Draw(Application.MagicContentManager.GetTexture("team"), _dst, _src, new Color(1, 1, 1, _currentAlpha)); spriteBatch.End(); ParticuleManager.Draw(false); }
public void Draw(SpriteBatchProxy spriteBatch) { spriteBatch.BeginNoCamera(); // Draw compass spriteBatch.Draw(Application.MagicContentManager.GetTexture("compass"), dRect, sRect, Color.White); foreach (CompassElement element in _elements.Values) { element.Draw(spriteBatch); } spriteBatch.End(); }
public override void Draw(SpriteBatchProxy spriteBatch) { // Draw the skybox _skybox.Draw(spriteBatch); ParticuleManager.Draw(true); spriteBatch.Begin(SceneCamera); _level.Draw(spriteBatch); if (Application.IsDebugMode) { // World base axis spriteBatch.DrawRectangle(new Rectangle(-1, -1, 2, _level.Dimensions.Height), Color.Red); spriteBatch.DrawRectangle(new Rectangle(-1, -1, _level.Dimensions.Width, 2), Color.Green); Application.PhysicsManager.Draw(spriteBatch); } spriteBatch.End(); ParticuleManager.Draw(false); // Draw HUD and Compass out of the camera if (_isEnded == false) { _hud.Draw(spriteBatch); _compass.Draw(spriteBatch); } spriteBatch.BeginNoCamera(); spriteBatch.DrawRectangle(new Rectangle(0, 0, Resolution.VirtualWidth, Resolution.VirtualHeight), Color.Black * _alphaPause); if (_isPaused) { // Draw "PAUSE" Vector2 _pauseLoc = new Vector2(Resolution.VirtualWidth / 2 - Application.MagicContentManager.Font.MeasureString("PAUSE").X / 2, 300); spriteBatch.DrawString(Application.MagicContentManager.Font, "PAUSE", _pauseLoc, Color.White * _alphaPause); // Draw controls var devices = Application.InputManager.GetLinkedDevices(LogicalPlayerIndex.One).FindAll(d => d.IsConnected); Vector2 buttonLoc = new Vector2((int)_pauseLoc.X - 150, _pauseLoc.Y + 60); for (int i = 0; i < devices.Count; i++) { ButtonPrinter.Draw(spriteBatch, MappingButtons.Start, devices[i], buttonLoc, Color.White * _alphaPause); buttonLoc.X += 50; } Vector2 textLoc = buttonLoc + new Vector2(100,0); spriteBatch.DrawString(Application.MagicContentManager.Font, LocalizedStrings.GetString("BackToGame"), textLoc, Color.White * _alphaPause); buttonLoc = new Vector2((int)_pauseLoc.X - 150, _pauseLoc.Y + 100); for (int i = 0; i < devices.Count; i++) { ButtonPrinter.Draw(spriteBatch, MappingButtons.Back, devices[i], buttonLoc, Color.White * _alphaPause); buttonLoc.X += 50; } textLoc = buttonLoc + new Vector2(100, 0); spriteBatch.DrawString(Application.MagicContentManager.Font, LocalizedStrings.GetString("BackToHome"), textLoc, Color.White * _alphaPause); } spriteBatch.End(); }
public override void Draw(SpriteBatchProxy spriteBatch) { ParticuleManager.Draw(true); spriteBatch.BeginNoCamera(); //----------------------------- // Bakcground spriteBatch.Draw(Application.MagicContentManager.GetTexture((_lose) ? "end_sad" : "end_happy"), new Rectangle(0, 0, Resolution.VirtualWidth, Resolution.VirtualHeight), Color.White); // Title spriteBatch.DrawString(Application.MagicContentManager.Font, _gameoverStr, _gameoverLoc, Color.White); Color color = Color.White; if (_lastItem >= 1) { string sEnd; if (_lose) { color = Color.Red; sEnd = LocalizedStrings.GetString("Defeat"); } else { color = Color.Green; sEnd = LocalizedStrings.GetString("Victory"); } if (_lastItem == 0) color *= _currentAlpha; var loc = new Vector2( Resolution.VirtualWidth / 2 - Application.MagicContentManager.Font.MeasureString(sEnd).X / 2, 100 ); spriteBatch.DrawString(Application.MagicContentManager.Font, sEnd, loc, color); } color = Color.White; int x = 200; int colSize = 300; int lineSize = 30; int y = 160; if (_lastItem >= 2) { if (_lastItem == 1) color *= _currentAlpha; var livesLoc = new Vector2(x + colSize, y); // Stats spriteBatch.DrawString(Application.MagicContentManager.Font, "Remaining lives: ", new Vector2(x, y), color); for (int i = 0; i < _lives; i++) { spriteBatch.Draw(Application.MagicContentManager.GetTexture("hud"), livesLoc, new Rectangle(0, 0, 32, 32), Color.White); livesLoc.X += 32; } } y += lineSize; if (_lastItem >= 3) { if (_lastItem == 1) color *= _currentAlpha; string sCarot = _carrotes.ToString("0000000"); spriteBatch.DrawString(Application.MagicContentManager.Font, "Carrottes: ", new Vector2(x, y), color); spriteBatch.DrawString(Application.MagicContentManager.Font, _carrotes.ToString("0000000"), new Vector2(x + colSize, y), color); Vector2 carotLoc = new Vector2(x + Application.MagicContentManager.Font.MeasureString(sCarot).X + colSize + 16, y - 4); spriteBatch.Draw(Application.MagicContentManager.GetTexture("hud"), carotLoc, new Rectangle(64, 0, 32, 32), Color.White); } y += lineSize; if (_lastItem >= 4) { if (_lastItem == 1) color *= _currentAlpha; spriteBatch.DrawString(Application.MagicContentManager.Font, "Time left: ", new Vector2(x, y), color); spriteBatch.DrawString(Application.MagicContentManager.Font, _timeLeft.Minutes.ToString("00") + ":" + _timeLeft.Seconds.ToString("00"), new Vector2(x + colSize, y), color); } y += lineSize; if (_lastItem >= 5) { if (_lastItem == 1) color *= _currentAlpha; spriteBatch.DrawString(Application.MagicContentManager.Font, "Keys: ", new Vector2(x, y), color); if (_hasKeys) { spriteBatch.Draw(Application.MagicContentManager.GetTexture("keys"), new Vector2(x + colSize, y) + new Vector2(0, -8), new Rectangle(0, 0, 32, 32), Color.White); } } y += lineSize; if (_lastItem >= 6) { if (_lastItem == 1) color *= _currentAlpha; spriteBatch.DrawString(Application.MagicContentManager.Font, "Letters: " + _letters.Count + "/" + OLetterSpawn.LetterCount, new Vector2(x, y), color); int letterScore = 2000 * _letters.Count + (_letters.Count == OLetterSpawn.LetterCount ? 10000 : 0); spriteBatch.DrawString(Application.MagicContentManager.Font, letterScore.ToString("000000000"), new Vector2(x + colSize, y), color); } y += lineSize * 2; if (_lastItem >= 7) { color = Color.Yellow; if (_lastItem == 1) color *= _currentAlpha; spriteBatch.DrawString(Application.MagicContentManager.Font, "Score: ", new Vector2(x, y), color); spriteBatch.DrawString(Application.MagicContentManager.Font, _score.ToString("000000000"), new Vector2(x + colSize, y), color); } //----------------------------- // Draw highscores button if (_lastItem >= ScoreLines) { spriteBatch.Draw(Application.MagicContentManager.GetTexture("menu"), _dstMenu, _srcMenu, Color.White, 0f, Vector2.Zero, Microsoft.Xna.Framework.Graphics.SpriteEffects.FlipHorizontally, 1.0f); spriteBatch.Draw(Application.MagicContentManager.GetTexture("hud"), _dstMenu.Location.ToVector2() + new Vector2(20, 16), new Rectangle(64, 0, 32, 32), Color.White); spriteBatch.DrawString(Application.MagicContentManager.Font, LocalizedStrings.GetString("Highscores"), _dstMenu.Location.ToVector2() + new Vector2(60, 20), Color.Yellow ); } spriteBatch.End(); ParticuleManager.Draw(false); }
public void Draw(SpriteBatchProxy spriteBatch) { spriteBatch.BeginNoCamera(); spriteBatch.Draw(Application.MagicContentManager.GetTexture("skybox"), new Rectangle(0, 0, Resolution.VirtualWidth, Resolution.VirtualHeight), _color); spriteBatch.End(); }
public override void Draw(SpriteBatchProxy spriteBatch) { ParticuleManager.Draw(true); spriteBatch.BeginNoCamera(); spriteBatch.Draw(Application.MagicContentManager.GetTexture("homebg"), _dstBg, _srcBg, _bgColor); spriteBatch.End(); //----------------------------------------------------------------------------------------------- spriteBatch.Begin(SceneCamera); if (!_isInitialized) { spriteBatch.Draw(Application.MagicContentManager.GetTexture("star"), _dstStar, _srcStar, Color.White); } spriteBatch.Draw(Application.MagicContentManager.GetTexture("title"), _dstTitle, _srcTitle, Color.White, TitltForTitle, Vector2.Zero, SpriteEffects.None, 1); foreach (Entity e in _asteroidLayer.Entities) { e.Draw(spriteBatch); } spriteBatch.End(); //----------------------------------------------------------------------------------------------- ParticuleManager.Draw(false); spriteBatch.Begin(SceneCamera); spriteBatch.Draw(Application.MagicContentManager.GetTexture("fore"), _dstFore, _srcFore, _generalColor); if (_textDisplayed && !_isInitialized) { spriteBatch.DrawString(Application.MagicContentManager.Font, _startStr, _startLoc, Color.White); } if (_isMenuDisplayed) { drawMenu(spriteBatch); } //----------------------------------------------------------------------------------------------- spriteBatch.End(); }