public static void GenerateLabels(NoteCollection song) { labels.Clear(); string titleFont = FontTools.ContainsJP(song.Metadata.Title) ? "JP" : "Franklin"; string artistFont = FontTools.ContainsJP(song.Metadata.Artist) ? "JP" : "Franklin"; // Top Row plotLocation.X = 60; plotLocation.Y = TopRowLocation; labels.Add(new Label(Globals.Font["Franklin"], "SCROLL", plotLocation, Color.White, Justification.Center, LabelType.FixedHeight, 10.0f)); plotLocation.X = 150; labels.Add(new Label(Globals.Font["Franklin"], "ACCURACY", plotLocation, Color.White, Justification.Left, LabelType.FixedHeight, 10.0f)); plotLocation.X = 1140; labels.Add(new Label(Globals.Font[titleFont], song.Metadata.Title, plotLocation, Color.White, Justification.Right, LabelType.FixedHeight, 40.0f)); plotLocation.X = 1200; labels.Add(new Label(Globals.Font["Franklin"], Enum.GetName(typeof(Difficulty), song.Metadata.Difficulty).ToUpper(), plotLocation, Color.White, Justification.Center, LabelType.FixedHeight, 10.0f)); // Bottom row plotLocation.X = 60; plotLocation.Y = BottomRowLocation; labels.Add(new Label(Globals.Font["Franklin"], Globals.SpeedScale.ToString("F1"), plotLocation, Color.White, Justification.Center | Justification.Bottom, LabelType.FixedHeight, 50.0f)); plotLocation.X = 150; labels.Add(new Label(Globals.Font["Franklin"], (song.CurrentScore / song.TotalNotes * 100.0).ToString("000.000"), plotLocation, Color.White, Justification.Left | Justification.Bottom, LabelType.FixedHeight, 40.0f)); plotLocation.X = 395; labels.Add(new Label(Globals.Font["Franklin"], "/ 100.000%", plotLocation, Color.White, Justification.Left | Justification.Bottom, LabelType.FixedHeight, 20.0f)); plotLocation.X = 1140; labels.Add(new Label(Globals.Font[artistFont], song.Metadata.Artist, plotLocation, Color.White, Justification.Right | Justification.Bottom, LabelType.FixedHeight, 30.0f)); plotLocation.X = 1200; labels.Add(new Label(Globals.Font["Franklin"], song.Metadata.Level.ToString("D2"), plotLocation, Color.White, Justification.Center | Justification.Bottom, LabelType.FixedHeight, 50.0f)); }
public static void Draw(SpriteBatch sb, NoteCollection song) { if (song == null) { return; } var log = Globals.DrawTempLog; sb.Begin(); sb.Draw(Globals.Textures["GpLowerBG"], new Vector2(0, 599), Color.Black); string titleFont = FontTools.ContainsJP(song.Metadata.Title) ? "JP" : "Franklin"; string artistFont = FontTools.ContainsJP(song.Metadata.Artist) ? "JP" : "Franklin"; if (Globals.DrawProfiling) { log.AddEvent(Globals.DrawStopwatch.ElapsedMilliseconds, "UI: BG"); } foreach (var label in labels) { label.Draw(sb); if (Globals.DrawProfiling) { if (labels.IndexOf(label) == 3) { log.AddEvent(Globals.DrawStopwatch.ElapsedMilliseconds, "UI: Top Row"); } if (labels.IndexOf(label) == 8) { log.AddEvent(Globals.DrawStopwatch.ElapsedMilliseconds, "UI: Bottom Row"); } } } if (Globals.AutoMode != GameSettingsScreen.AutoMode.Off) { plotLocation.X = Globals.WindowSize.X - 10; plotLocation.Y = 10; string str = Globals.AutoMode == GameSettingsScreen.AutoMode.Auto ? "AUTO MODE ENABLED" : "AUTO DOWN ENABLED"; sb.DrawStringJustify(Globals.Font["Franklin"], str, plotLocation, Color.White, 0.1f, Justification.Top | Justification.Right); } sb.End(); }
public static void UpdateText(NoteCollection song) { // Note Counts updatedableLabels[LabelField.StylishCount] = new Label(Globals.Font["Franklin"], song.PerfectCount.ToString("D4"), gradeTotalPoint, Color.White, Justification.Right | Justification.Bottom, LabelType.FixedHeight, fontHeightMain, defaultStroke); updatedableLabels[LabelField.CoolCount] = new Label(Globals.Font["Franklin"], song.GreatCount.ToString("D4"), gradeTotalPoint + gradeLabelOffset, Color.White, Justification.Right | Justification.Bottom, LabelType.FixedHeight, fontHeightMain, defaultStroke); updatedableLabels[LabelField.GoodCount] = new Label(Globals.Font["Franklin"], song.GoodCount.ToString("D4"), gradeTotalPoint + 2 * gradeLabelOffset, Color.White, Justification.Right | Justification.Bottom, LabelType.FixedHeight, fontHeightMain, defaultStroke); updatedableLabels[LabelField.MissCount] = new Label(Globals.Font["Franklin"], song.MissCount.ToString("D4"), gradeTotalPoint + 3 * gradeLabelOffset, Color.White, Justification.Right | Justification.Bottom, LabelType.FixedHeight, fontHeightMain, defaultStroke); // Score updatedableLabels[LabelField.Score] = new Label(Globals.Font["Franklin"], (song.CurrentScore / song.TotalNotes * 100.0f).ToString("F3") + "%", new Vector2(780, 500), Color.White, Justification.Right | Justification.Bottom, LabelType.FixedHeight, 50.0f, defaultStroke); // Clear/Fail String string result = ""; Color fontCol = Color.White; Color strokeCol = Color.Black; switch (song.SongEnd) { case SongEndReason.Undefined: break; case SongEndReason.Forfeit: result = "Forfeited"; fontCol = Color.LightGray; strokeCol = Color.Gray; break; case SongEndReason.Failed: result = "Failed"; fontCol = ThemeColors.FailedFont; strokeCol = ThemeColors.FailedStroke; break; case SongEndReason.Cleared: if (song.MissCount > 0) { result = "Cleared"; fontCol = ThemeColors.ClearedFont; strokeCol = ThemeColors.ClearedStroke; } else { result = "Full Combo"; fontCol = ThemeColors.FullComboFont; strokeCol = ThemeColors.FullComboStroke; } break; default: break; } updatedableLabels[LabelField.Result] = new Label(Globals.Font["Franklin"], result, gradeTotalPoint - gradeLabelOffset, fontCol, Justification.Right | Justification.Bottom, LabelType.FixedHeight, fontHeightMain, new Label.Stroke(2.0f, strokeCol)); // Song Info string titleFont = FontTools.ContainsJP(song.Metadata.Title) ? "JP" : "Franklin"; string artistFont = FontTools.ContainsJP(song.Metadata.Artist) ? "JP" : "Franklin"; updatedableLabels[LabelField.Title] = new Label(Globals.Font[titleFont], song.Metadata.Title, new Vector2(Globals.WindowSize.X / 2, 100), Color.White, Justification.Center | Justification.Top, LabelType.FixedHeight, fontHeightMain + 5.0f, defaultStroke); updatedableLabels[LabelField.Artist] = new Label(Globals.Font[artistFont], song.Metadata.Artist, new Vector2(Globals.WindowSize.X / 2, 140), Color.White, Justification.Center | Justification.Top, LabelType.FixedHeight, fontHeightMain, defaultStroke); updatedableLabels[LabelField.Level] = new Label(Globals.Font["Franklin"], "Lv. " + song.Metadata.Level.ToString("D2"), new Vector2(Globals.WindowSize.X / 2, 170), Color.White, Justification.Center | Justification.Top, LabelType.FixedHeight, fontHeightMain, defaultStroke); }
public static void Draw(SpriteBatch sb, NoteCollection song) { sb.Begin(SpriteSortMode.Deferred, null, SamplerState.PointClamp); // BG lines sb.Draw(Globals.Textures["ResultBg3"], Globals.Origin, song.Metadata.ColorAccent.IfNull(ThemeColors.BrightGreen)); sb.Draw(Globals.Textures["ResultBg2"], Globals.Origin, song.Metadata.ColorBack.IfNull(ThemeColors.Purple)); sb.Draw(Globals.Textures["ResultBg1"], Globals.Origin, song.Metadata.ColorFore.IfNull(ThemeColors.Pink)); sb.Draw(Globals.Textures["ResultBgRight"], new Vector2(731, 0), Color.White); //// Title //sb.DrawStringFixedHeight(Globals.Font["RunningStart"], "RESULTS", new Vector2(Globals.WindowSize.X / 2, 30), Color.White, 50.0f, Justification.Center | Justification.Top, 2, Color.Black); foreach (var label in fixedLabels) { label.Draw(sb); } //// Grade Labels //sb.DrawStringFixedHeight(Globals.Font["Franklin"], "STYLISH", gradeLabelsPoint, ThemeColors.Stylish, fontHeightMain, Justification.Left | Justification.Bottom, 2, Color.Black); //sb.DrawStringFixedHeight(Globals.Font["Franklin"], "COOL", gradeLabelsPoint + gradeLabelOffset, ThemeColors.Good, fontHeightMain, Justification.Left | Justification.Bottom, 2, Color.Black); //sb.DrawStringFixedHeight(Globals.Font["Franklin"], "GOOD", gradeLabelsPoint + 2* gradeLabelOffset, ThemeColors.Bad, fontHeightMain, Justification.Left | Justification.Bottom, 2, Color.Black); //sb.DrawStringFixedHeight(Globals.Font["Franklin"], "MISS", gradeLabelsPoint + 3 * gradeLabelOffset, ThemeColors.Miss, fontHeightMain, Justification.Left | Justification.Bottom, 2, Color.Black); //// Note Counts //sb.DrawStringFixedHeight(Globals.Font["Franklin"], song.PerfectCount.ToString("D4"), gradeTotalPoint, Color.White, fontHeightMain, Justification.Right | Justification.Bottom, 2, Color.Black); //sb.DrawStringFixedHeight(Globals.Font["Franklin"], song.GreatCount.ToString("D4"), gradeTotalPoint + gradeLabelOffset, Color.White, fontHeightMain, Justification.Right | Justification.Bottom, 2, Color.Black); //sb.DrawStringFixedHeight(Globals.Font["Franklin"], song.GoodCount.ToString("D4"), gradeTotalPoint + 2 * gradeLabelOffset, Color.White, fontHeightMain, Justification.Right | Justification.Bottom, 2, Color.Black); //sb.DrawStringFixedHeight(Globals.Font["Franklin"], song.MissCount.ToString("D4"), gradeTotalPoint + 3 * gradeLabelOffset, Color.White, fontHeightMain, Justification.Right | Justification.Bottom, 2, Color.Black); //// Score //sb.DrawStringFixedHeight(Globals.Font["Franklin"], (song.CurrentScore / song.TotalNotes * 100.0f).ToString("F3") + "%", new Vector2(780, 500), Color.White, 50.0f, Justification.Right | Justification.Bottom, 2, Color.Black); //// Clear/Fail String //string result = ""; //Color fontCol = Color.White; //Color strokeCol = Color.Black; //switch (song.SongEnd) //{ // case SongEndReason.Undefined: // break; // case SongEndReason.Forfeit: // result = "Forfeited"; // fontCol = Color.LightGray; // strokeCol = Color.Gray; // break; // case SongEndReason.Failed: // result = "Failed"; // fontCol = ThemeColors.FailedFont; // strokeCol = ThemeColors.FailedStroke; // break; // case SongEndReason.Cleared: // if (song.MissCount > 0) // { // result = "Cleared"; // fontCol = ThemeColors.ClearedFont; // strokeCol = ThemeColors.ClearedStroke; // } // else // { // result = "Full Combo"; // fontCol = ThemeColors.FullComboFont; // strokeCol = ThemeColors.FullComboStroke; // } // break; // default: // break; //} //sb.DrawStringFixedHeight(Globals.Font["Franklin"], result, gradeTotalPoint - gradeLabelOffset, fontCol, fontHeightMain, Justification.Right | Justification.Bottom, 2, strokeCol); foreach (var label in updatedableLabels) { label.Value.Draw(sb); } // Stars int id = GetStarID((float)(song.CurrentScore / song.TotalNotes * 100.0f)); sb.Draw(Globals.Textures["Star" + id], starPoint, Color.White); //// Song Info //string titleFont = FontTools.ContainsJP(song.Metadata.Title) ? "JP" : "Franklin"; //string artistFont = FontTools.ContainsJP(song.Metadata.Artist) ? "JP" : "Franklin"; //sb.DrawStringFixedHeight(Globals.Font[titleFont], song.Metadata.Title, new Vector2(Globals.WindowSize.X / 2, 100), Color.White, fontHeightMain + 5.0f, Justification.Center | Justification.Top, 2, Color.Black); //sb.DrawStringFixedHeight(Globals.Font[artistFont], song.Metadata.Artist, new Vector2(Globals.WindowSize.X / 2, 140), Color.White, fontHeightMain, Justification.Center | Justification.Top, 2, Color.Black); //sb.DrawStringFixedHeight(Globals.Font["Franklin"], "Lv. " + song.Metadata.Level.ToString("D2"), new Vector2(Globals.WindowSize.X / 2, 170), Color.White, fontHeightMain, Justification.Center | Justification.Top, 2, Color.Black); // Album cover? // sb.Draw(song.Metadata.AlbumImage, albumRect, Color.White); sb.End(); }