void DrawDialog() { dialogPos.X = (int)Global.GraphicsManager.GraphicsDevice.Viewport.Project(_droneFleet.GetActiveDrone().Position, Global.Camera.ProjectionMatrix, Global.Camera.ViewMatrix, Matrix.Identity).X + 32; dialogPos.Y = (int)Global.GraphicsManager.GraphicsDevice.Viewport.Project(_droneFleet.GetActiveDrone().Position, Global.Camera.ProjectionMatrix, Global.Camera.ViewMatrix, Matrix.Identity).Y + 32; tutorialDialog.Draw(dialogPos, tutorialMessage); captainDialog.Draw(new Point(dialogPos.X, dialogPos.Y - 170), " Briefing\n\n General Stargaz\n\nPilot!\nYour mission is simple!\nDefend this station against the alien\nthreat or die trying!\nDismissed!"); captain.Draw(new Point(dialogPos.X + 10, dialogPos.Y - 165), 1, Color.White); }
//################################################################################################### // Helper //################################################################################################### //################################# // Helper Draw - Arrow //################################# void DrawStationDirectionArrow() { if (Vector3.Distance(_droneFleet.GetActiveDrone().Position, _station.Position) > 300) { var vec3 = _station.Position - _droneFleet.GetActiveDrone().Position; vec3.Normalize(); var vec = new Vector2(); vec.X = Global.GraphicsManager.GraphicsDevice.Viewport.Project(_droneFleet.GetActiveDrone().Position + vec3 * 100, Global.Camera.ProjectionMatrix, Global.Camera.ViewMatrix, Matrix.Identity).X; vec.Y = Global.GraphicsManager.GraphicsDevice.Viewport.Project(_droneFleet.GetActiveDrone().Position + vec3 * 100, Global.Camera.ProjectionMatrix, Global.Camera.ViewMatrix, Matrix.Identity).Y; _stationSymbol.Draw(vec.ToPoint(), 1, Global.StationColor); } }
//################################# // Draw //################################# public override void Draw(GameTime gameTime) { drawMenuEntries(gameTime); string entry; ShopText.TryGetValue(selectedEntry, out entry); _itemDialog.Draw(entry); _acagamics.Draw(new Point(Global.GraphicsManager.GraphicsDevice.Viewport.Width / 2 + 450, Global.GraphicsManager.GraphicsDevice.Viewport.Height - 640), 1, Color.White); _frame.Draw(); }
//################################# // Draw //################################# public void Draw(DroneBuilder droneFleet) { _shields.Draw(new Point(50, Global.GraphicsManager.GraphicsDevice.Viewport.Height - 130), droneFleet._armor, new Color(1f, 1f, 1f, 0.5f)); _rocketSymbol.Draw(new Point(355, 717), 1, new Color(1f, 1f, 1f, 0.5f)); Global.UIBatch.Begin(); Global.UIBatch.DrawString(Global.Font, Global.NumberOfRockets.ToString(), new Vector2(390, 725), new Color(58f, 116f, 112f)); Global.UIBatch.End(); Bars[0].Draw(droneFleet.GetActiveDrone().health, droneFleet.GetActiveDrone().maxHealth); Bars[1].Draw(droneFleet.GetActiveDrone().shield, droneFleet.GetActiveDrone().maxShield); /* * if (Vector3.Distance(this._station.Position, droneFleet.GetActiveDrone().Position) < 300) * { * var vec = new Point(); * vec.X = (int)Global.GraphicsManager.GraphicsDevice.Viewport.Project(_station.Position, Global.Camera.ProjectionMatrix, Global.Camera.ViewMatrix, Matrix.Identity).X - 80; * vec.Y = (int)Global.GraphicsManager.GraphicsDevice.Viewport.Project(_station.Position, Global.Camera.ProjectionMatrix, Global.Camera.ViewMatrix, Matrix.Identity).Y - 90; * Bars[2].Draw(vec, _station._health, _station._maxhealth); * vec.Y = (int)Global.GraphicsManager.GraphicsDevice.Viewport.Project(_station.Position, Global.Camera.ProjectionMatrix, Global.Camera.ViewMatrix, Matrix.Identity).Y - 80; * Bars[3].Draw(vec, _station._shield, _station._maxShield); * } * else * {*/ Bars[2].Draw(_station._health, _station._maxhealth); Bars[3].Draw(_station._shield, _station._maxShield); //} _scoreDialog.Draw("Score: " + Global.HighScorePoints.ToString()); _moneyDialog.Draw("Fragments: " + Global.Money); float _distance = Vector2.Distance(new Vector2(droneFleet.GetActiveDrone().Position.X, droneFleet.GetActiveDrone().Position.Z), Vector2.Zero); if (_distance > Global.MapRingRadius && _distance < Global.MapRingRadius + 80) { _alertDialog.Draw("ALERT! OUT OF RANGE", Color.OrangeRed); } else if (_distance > Global.MapRingRadius + 80) { _alertDialog.Draw("ALERT! SHIP FAILURE", Color.Red); } if (Global.Money >= 0) { if ((Vector3.Distance(this._station.Position, droneFleet.GetActiveDrone().Position) - GameplayScreen._stationHeight) < 150) { _upgradeVincinityDialog.Draw("Press B for Shop!"); } } }
void DrawShipDirectionArrow() { if (_waveBuilder.ShipList.Count > 0) { float minDistance = float.MaxValue; Vector3 posS = Vector3.Zero; foreach (var ship in _waveBuilder.ShipList) { var val = Math.Min(Vector3.Distance(_droneFleet.GetActiveDrone().Position, ship.Position), minDistance); if (minDistance != val) { minDistance = val; posS = ship.Position; } } var vec3 = posS - _droneFleet.GetActiveDrone().Position; vec3.Normalize(); var vec = new Vector2(); vec.X = Global.GraphicsManager.GraphicsDevice.Viewport.Project(_droneFleet.GetActiveDrone().Position + vec3 * 50, Global.Camera.ProjectionMatrix, Global.Camera.ViewMatrix, Matrix.Identity).X; vec.Y = Global.GraphicsManager.GraphicsDevice.Viewport.Project(_droneFleet.GetActiveDrone().Position + vec3 * 50, Global.Camera.ProjectionMatrix, Global.Camera.ViewMatrix, Matrix.Identity).Y; _enemySymbol.Draw(vec.ToPoint(), 1, Color.Red); } }
void DrawCaptainDialog(Point pos, string msg) { captainDialog.Draw(new Point(pos.X, pos.Y - 170), msg); captain.Draw(new Point(pos.X + 10, pos.Y - 165), 1, Color.White); }