private void DrawModeSpecific() { DrawModeSpecificPerPlayer(); switch ((GameType)Core.Cookies["CurrentGameType"]) { case GameType.NORMAL: break; case GameType.COOPERATIVE: var totalScore = (from e in Core.Players where e.Playing select e.Score).Sum(); _coopScoreDisplay.Draw(); FontManager.DrawString("" + totalScore, "LargeFont", Core.Metrics["EvaluationTotalScore", 0], Color.White, FontAlign.Right); int gradeIndex = _grades[0]; _gradeSpriteMap.Draw(gradeIndex, 150, 52, Core.Metrics["EvaluationTotalGrade", 0]); break; case GameType.TEAM: case GameType.VS_CPU: var teamAScore = (from e in Core.Players where (e.Playing && e.Team == 1) select e.Score).Sum(); var teamBScore = (from e in Core.Players where (e.Playing && e.Team == 2) select e.Score).Sum(); _teamScoreMeter.BlueScore = teamAScore; _teamScoreMeter.RedScore = teamBScore; _teamScoreMeter.Draw(); _teamScoreMeter.Update(); break; } }
private void DrawVSCPUDifficultySelect() { _messageBorderSprite.Draw(); FontManager.DrawString(Core.Text["ModeSelectCPULevel"], "DefaultFont", Core.Metrics["RestrictionMessage", 0], Color.White, FontAlign.Left); FontManager.DrawString(Core.CPUManager.SkillNames[_selectedCPUSkill], "DefaultFont", Core.Metrics["SelectedCPUDifficulty", 0], Color.White, FontAlign.Left); var position = Core.Metrics["SelectedCPUDifficulty", 0]; _arrowSpriteMap.Draw(1, 24, 24, (int)position.X - 25, (int)position.Y); _arrowSpriteMap.Draw(0, 24, 24, (int)position.X + 220, (int)position.Y); }
private void DrawBorder() { _xborder.Draw(1, 20, this.Height, this.X - 20, this.Y); _xborder.Draw(0, 20, this.Height, this.X + this.Width, this.Y); _yborder.Draw(1, this.Width, 20, this.X, this.Y - 20); _yborder.Draw(0, this.Width, 20, this.X, this.Y + this.Height); _cornerSpriteMap.Draw(0, this.X - 20, this.Y - 20); _cornerSpriteMap.Draw(1, this.X + this.Width, this.Y - 20); _cornerSpriteMap.Draw(2, this.X - 20, this.Y + this.Height); _cornerSpriteMap.Draw(3, this.X + this.Width, this.Y + this.Height); }
private void DrawModeOptions() { var midpoint = Core.Metrics["ModeSelectOptions", 0].Clone(); midpoint.X += (int)_listDrawOffset; var optionSize = Core.Metrics["ModeSelectOptions.Size", 0].Clone(); var gap = optionSize.X + 5; int index = _selectedGameType; //Draw selected game type. _optionBaseSpriteMap.Draw(1, optionSize, midpoint); var allowed = String.IsNullOrEmpty(GameTypeAllowed((GameType)index)); _optionsSpriteMap.ColorShading = allowed ? Color.White : _disabledColor; _optionsSpriteMap.Draw(index, optionSize.X - 20, optionSize.Y - 20, (int)midpoint.X + 10, (int)midpoint.Y + 10); //Draw Mode options to the right of (after) the selected one. for (int x = 1; x <= LIST_ITEMS_DRAWN; x++) { index = (index + 1) % (int)GameType.COUNT; midpoint.X += gap; _optionBaseSpriteMap.Draw(0, optionSize, midpoint); allowed = String.IsNullOrEmpty(GameTypeAllowed((GameType)index)); _optionsSpriteMap.ColorShading = allowed ? Color.White : _disabledColor; _optionsSpriteMap.Draw(index, optionSize.X - 20, optionSize.Y - 20, (int)midpoint.X + 10, (int)midpoint.Y + 10); } midpoint.X -= gap * LIST_ITEMS_DRAWN; index = _selectedGameType; //Draw Mode options to the left of (before) the selected one. for (int x = 1; x <= LIST_ITEMS_DRAWN; x++) { index -= 1; if (index < 0) { index = (int)GameType.COUNT - 1; } midpoint.X -= gap; _optionBaseSpriteMap.Draw(0, optionSize, midpoint); allowed = String.IsNullOrEmpty(GameTypeAllowed((GameType)index)); _optionsSpriteMap.ColorShading = allowed ? Color.White : _disabledColor; _optionsSpriteMap.Draw(index, optionSize.X - 20, optionSize.Y - 20, (int)midpoint.X + 10, (int)midpoint.Y + 10); } midpoint.X -= (int)_listDrawOffset; var changeMx = Math.Min(1.0, TextureManager.LastGameTime.ElapsedRealTime.TotalSeconds * MODE_CHANGE_SPEED); _listDrawOffset -= (_listDrawOffset * (changeMx)); }
private void DrawIndividualScores() { if (SyncGameType) { return; } for (int x = 0; x < 4; x++) { if (!Players[x].Playing) { continue; } var idx = (Players[x].IsCPUPlayer) ? 4 : x; _individualBaseSprite.Position = _metrics["ScoreBase", x]; _individualBaseSprite.Size = _metrics["ScoreBase.Size", 0]; _individualBaseSprite.Draw(); _individualPulseSprite.Position = _metrics["ScoreBase", x]; _individualPulseSprite.ColorShading = _pulseColors[x]; _individualPulseSprite.ColorShading.A = (byte)Math.Min(255, 4 * Math.Sqrt(Players[x].Score - _displayedScores[x])); _individualPulseSprite.Draw(); var identifierPosition = _metrics["ScoreBase", x].Clone(); identifierPosition.X += 12; identifierPosition.Y += 5; _playerIdentifierSpriteMap.Draw(idx, _metrics["MainGamePlayerIdentifiers.Size", 0], identifierPosition); FontManager.DrawString("" + Math.Ceiling(_displayedScores[x]), "LargeFont", _metrics["ScoreText", x], Color.White, FontAlign.Right); } }
private void DrawMarkers() { var markerSize = Core.Metrics["PlayerTeamMarkers.Size", 0]; var playerReadyMarkerSize = Core.Metrics["PlayerTeamReadyMarkers.Size", 0]; for (int x = 0; x < 4; x++) { if (!Core.Players[x].Playing) { continue; } var markerPosition = new Vector2(Core.Metrics["PlayerTeamMarkers", x].X, Core.Metrics["PlayerTeamMarkers", x].Y); if (Core.Players[x].Team == 1) { markerPosition -= Core.Metrics["PlayerTeamMarkers.Movement", 0]; } if (Core.Players[x].Team == 2) { markerPosition += Core.Metrics["PlayerTeamMarkers.Movement", 0]; } if (_ready[x]) { _playerReadyMarkers.Draw(2 - Core.Players[x].Team, playerReadyMarkerSize.X, playerReadyMarkerSize.Y, markerPosition.X - 65, markerPosition.Y); } _playerMarkers.Draw(x, markerSize, markerPosition); } }
private void DrawPlayerDifficulties() { if (SyncGameType) { return; } for (int x = 0; x < 4; x++) { if (!Players[x].Playing) { continue; } int idx = 1 + (int)(Players[x].PlayerOptions.PlayDifficulty); _iconSpriteMap.Draw(idx, 30, 30, _metrics["GameScreenPlayerDifficulties", x]); } }
private void DrawModeDescription() { _descriptionBaseSprite.Draw(); var gameType = (GameType)_selectedGameType; FontManager.DrawString(GetModeDescription(gameType), "DefaultFont", Core.Metrics["ModeDescription", 0], Color.Black, FontAlign.Left); _previewsSpriteMap.Draw(_selectedGameType, Core.Metrics["ModeDescriptionPreview", 0]); }
public override void Draw(GameTime gameTime, SpriteBatch spriteBatch) { DrawBackground(gameTime); DrawPlayerOptions(); _headerSprite.Draw(); DrawModeOptions(); DrawModeDescription(); DrawRestriction(); if (_selectingCPUSkill) { DrawVSCPUDifficultySelect(); } _edgeSpriteMap.Draw(0, 20, 160, Core.Metrics["ModeSelectEdge", 0]); _edgeSpriteMap.Draw(1, 20, 160, Core.Metrics["ModeSelectEdge", 1]); }
private void DrawOverlay() { _headerSprite.Draw(); //Draw Grid top for (int x = 0; x < 4; x++) { var idx = x; if (x != (_currentPlayer - 1)) { idx += 4; } _gridTopSpriteMap.Draw(idx, Core.Metrics["KeyOptionGridTop.Size", 0], Core.Metrics["KeyOptionGridTop", x]); } //Draw Grid Side _actionPosition = Core.Metrics["KeyOptionGridSide", 0].Clone(); var actionSize = Core.Metrics["KeyOptionGridSide.Size", 0]; _textPosition = Core.Metrics["KeyOptionGridSideText", 0].Clone(); for (int x = 0; x < _actions.Length; x++) { var idx = _currentPlayer - 1; if (x != _selectedAction) { idx += 4; } _gridSideSpriteMap.Draw(idx, actionSize, _actionPosition); FontManager.DrawString(_actions[x], "LargeFont", _textPosition, Color.Black, FontAlign.Right); _actionPosition.Y += actionSize.Y; _textPosition.Y += actionSize.Y; } //Draw Grid Inside var size = Core.Metrics["KeyOptionGridInsideSize", 0]; _gridInsideSpriteMap.Draw(_currentPlayer - 1, size.X, size.Y, Core.Metrics["KeyOptionGridInside", 0]); //Draw Border _gridBorderSprite.Draw(); //Draw Bindings. _bindingPosition = Core.Metrics["KeyOptionGridBindings", 0].Clone(); var bindingSize = Core.Metrics["KeyOptionGridBindings.Size", 0]; foreach (ActionBinding ab in _actionBindings) { ab.Position = _bindingPosition; ab.Size = bindingSize; ab.Draw(); _bindingPosition.Y += bindingSize.Y + 5; } }
private void DrawLegend() { var legendPosition = this.Position.Clone(); var legendItemSize = GameCore.Instance.Metrics["GraphLegendItem.Size", 0]; _legendSpriteMap.ColorShading.A = _teamLegendSpriteMap.ColorShading.A = 96; switch (LegendStyle) { case LegendStyle.Normal: legendPosition.Y += this.Height - legendItemSize.Y - 5; legendPosition.X += this.Width - legendItemSize.X - 5; for (int x = 3; x >= 0; x--) { if (_lineData[x].Length <= 0) { continue; } var colorID = (x == CPUPlayerID) ? 4 : x; _legendSpriteMap.Draw(colorID, legendItemSize, legendPosition); legendPosition.X -= legendItemSize.X + 5; } break; case LegendStyle.Teams: var tlegendItemSize = GameCore.Instance.Metrics["GraphLegendItem.Size", 1]; legendPosition.Y += this.Height - tlegendItemSize.Y - 5; legendPosition.X += this.Width - tlegendItemSize.X - 5; _teamLegendSpriteMap.Draw(1, tlegendItemSize, legendPosition); legendPosition.X -= tlegendItemSize.X + 5; _teamLegendSpriteMap.Draw(0, tlegendItemSize, legendPosition); break; } }
public void Draw(double phraseNumber) { var visiblePlayers = 0; for (int x = 0; x < Players.Count(); x++) { if (!Players[x].Playing) { continue; } for (int y = 0; y < _threshholds.Count(); y++) { if (phraseNumber < _threshholds[y]) { _countdownSpriteMap.ColorShading.A = (byte)Math.Min(255, (_threshholds[y] - phraseNumber) * 255 * 4); _countdownSpriteMap.Draw(y, _metrics["Countdown.Size", 0], SyncGameType ? _metrics["SyncCountdown", visiblePlayers]: _metrics["Countdown", x]); break; } } visiblePlayers++; } }