Beispiel #1
0
        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();
        }
Beispiel #2
0
 public void DrawFade(SpriteBatchProxy spriteBatch)
 {
     spriteBatch.DrawRectangle(new Rectangle(0, 0, Resolution.VirtualWidth, Resolution.VirtualHeight), _fadingColor * _currentFadeInOut);
 }