public override void Draw(SpriteBatch sp) { sp.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, null, null, null, null, _camera.GetTransfromMatrix()); sp.Draw(_background, Vector2.Zero, Color.White); DrawObj(sp); _parManager.Draw(sp); _map1.Draw(sp); if (_gameIsPlaying) { /// show death and kill _deathCount.SetPosition(_camera.GetFollowPos() + new Vector2((int)(Consts.VIEWPORT_WIDTH / 2 - _deathCount.GetBoundingBox().Width), (int)(-Consts.VIEWPORT_HEIGHT / 2))); _deathCount.Draw(sp); _killCount.SetPosition(_camera.GetFollowPos() + new Vector2((int)(Consts.VIEWPORT_WIDTH / 2 - _deathCount.GetBoundingBox().Width * 2), (int)(-Consts.VIEWPORT_HEIGHT / 2))); //_killCount.SetPosition(_camera.GetFollowPos() + new Vector2((int)(Consts.VIEWPORT_WIDTH / 2 - _deathCount.GetBoundingBox().Width), (int)(-Consts.VIEWPORT_HEIGHT / 2 + _deathCount.GetBoundingBox().Height))); _killCount.Draw(sp); // death state effect Tank tank = (Tank)_network.GetMainTank(); if (!tank.IsAlive()) { //sp.DrawString(_font, ""+(int)delayTime, _camera.GetFollowPos(), Color.Red); sp.Draw(_deathBG, new Rectangle((int)_camera.GetFollowPos().X - 400, (int)_camera.GetFollowPos().Y - 300, 800, 600), Color.White); DrawDeathScreen(sp); } } else { this.DrawEndGame(sp); _okButton.SetPosition(_camera.GetFollowPos() + new Vector2(-_okButton.GetBoundingBox().Width / 2 + 20, _okButton.GetBoundingBox().Height)); _okButton.Draw(sp); } sp.End(); base.Draw(sp); }
public override void Draw(DeviceContext context, int index) { switch (index) { case 0: //Relay Debug Component Update if (_displayInfo.Visible) { _displayInfo.Draw(context, 0); } if (_fps.Visible) { _fps.Draw(context, 0); } break; case 1: // Draw After The Gui //Draw only if the component is visible and has the focus if (_game.ComponentsPerfMonitor.Updatable && _mainControl.Dpc != null && _mainControl.Dpc.Parent != null && _mainControl.Dpc.Parent.Parent != null) { if (_mainControl.DebugWindow.Children[0] == _mainControl.Dpc) { _chart.ScreenPosition = new SharpDX.Rectangle((int)_mainControl.DebugWindow.Bounds.Left.Offset + (int)_mainControl.Dpc.Bounds.Left.Offset + 10, (int)_engine.ViewPort.Height - (int)_mainControl.DebugWindow.Bounds.Bottom.Offset + 10, (int)_mainControl.DebugWindow.Bounds.Left.Offset + (int)_mainControl.Dpc.Bounds.Left.Offset + (int)_mainControl.Dpc.Bounds.Size.X.Offset - 10, (int)_engine.ViewPort.Height - (int)_mainControl.DebugWindow.Bounds.Bottom.Offset + 150); _chart.Draw(context, 0); } } break; } }