public void Draw() { if (_world == null) { return; } _graphicsDevice.Clear(Color.Black); var yOffset = HUDSpriteFactory.ScreenHeight + _pauseMachine.YOffset; _spriteBatch.Begin(SpriteSortMode.Immediate, null, SamplerState.PointClamp, null, null, null, Matrix.CreateScale(Scale) * Matrix.CreateTranslation(_camera.X * Scale, (_camera.Y + yOffset) * Scale, 0.0f)); if (_survivalManager.PartyHard) { _partyTime.Apply(); } foreach (var drawable in _world.CameraDrawables) { drawable.Draw(); } _spriteBatch.End(); _spriteBatch.Begin(SpriteSortMode.Immediate, null, SamplerState.PointClamp, null, null, null, Matrix.CreateScale(Scale) * Matrix.CreateTranslation(0.0f, yOffset * Scale, 0.0f)); if (_survivalManager.PartyHard) { _partyTime.Apply(); } foreach (var drawable in _world.FixedDrawables) { drawable.Draw(); } _spriteBatch.End(); _spriteBatch.Begin(); foreach (var drawable in _world.UnscaledDrawables) { drawable.Draw(); } _spriteBatch.End(); }
private void DrawPan() { const int yOffset = HUDSpriteFactory.ScreenHeight; _spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointClamp, null, null, null, Matrix.CreateScale(Scale) * Matrix.CreateTranslation(_panAnimation.SourceOffset.X * Scale, (_panAnimation.SourceOffset.Y + yOffset) * Scale, 0.0f)); if (_partyHard) { _partyTime.Apply(); } _sourceScene.Draw(); _spriteBatch.End(); _spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointClamp, null, null, null, Matrix.CreateScale(Scale) * Matrix.CreateTranslation(_panAnimation.DestinationOffset.X * Scale, (_panAnimation.DestinationOffset.Y + yOffset) * Scale, 0.0f)); if (_partyHard) { _partyTime.Apply(); } _destinationScene.Draw(); _spriteBatch.End(); }