Added text to credits-screen.

This commit is contained in:
Florian Kuepper authored and Alexander Eckart committed 2012-03-15 16:54:33 +08:00
1 parent 704a7cffe2
commit fee141321b
1 file changed
+81 -5
+81 -5
View File
@@ -41,6 +41,10 @@ namespace Vocaluxe.Screens
private Stopwatch LogoTimer;
private Stopwatch CreditsTimer;
private Stopwatch TextTimer;
private List<string[]> paragraphs;
private List<CText> paragraphTexts;
public CScreenCredits()
{
@@ -56,6 +60,26 @@ namespace Vocaluxe.Screens
LogoTimer = new Stopwatch();
CreditsTimer = new Stopwatch();
TextTimer = new Stopwatch();
//Text for last part of credits.
paragraphTexts = new List<CText>();
paragraphs = new List<string[]>();
string paragraph = "Inspired by the achievements of UltraStar Deluxe and its variants and pursuing the goal of making a good thing even better, we ended up rewriting the game from scratch. And a new implementation in a new programming language called for a new name - and VOCALUXE it is!";
string[] words = paragraph.Split(new Char[] { ' ' });
paragraphs.Add(words);
paragraph = "This first public version has already implemented many of the original features and it is fully compatible with all the song files in your existing song collection. The code design allows a much faster implementation of new features, thus the roadmap for the next few stable releases is packed and we expect much shorter release cycles than ever before. And, of course, our and your ideas may be the features of tomorrow.";
words = paragraph.Split(new Char[] { ' ' });
paragraphs.Add(words);
paragraph = "We appreciate the feedback in the beta release phase and are, of course, always open for bug reports, suggestions for improve- ments and ideas for new features. We would also like to thank the translators who make Vocaluxe an international experience from the very beginning. Last, but most definitely not least, we thank all those diligent song makers out there - there's a song for everyone!";
words = paragraph.Split(new Char[] { ' ' });
paragraphs.Add(words);
paragraph = "Go ahead and grab your mics, crank up your stereo, warm up your voice and get ready to sing to the best of your abilities!";
words = paragraph.Split(new Char[] { ' ' });
paragraphs.Add(words);
}
public override bool HandleInput(KeyEvent KeyEvent)
@@ -210,9 +234,39 @@ namespace Vocaluxe.Screens
CreditEntryPinky007.direction = EDirection.Right;
_CreditNames.Add(CreditEntryPinky007);
//Prepare Text
int lastY = 280;
for (int i = 0; i < paragraphs.Count; i++)
{
string line = "";
for (int e = 0; e < paragraphs[i].Length; e++ )
{
if (paragraphs[i][e] != null)
{
string newline = line + " " + paragraphs[i][e];
CText text = new CText(75, lastY, -2, 30, -1, EAlignment.Left, EStyle.Bold, "Outline", new SColorF(1, 1, 1, 1), line);
if (CDraw.GetTextBounds(text).Width < (CSettings.iRenderW - 160))
{
line = line + " " + paragraphs[i][e];
//CreditEntry.image = new CStatic(tex, new SColorF(1, 1, 1, 1), new SRectF(0, 0, 350, 110, -4));
//Check if all words are used
if ((e + 1) == paragraphs[i].Length)
{
text.Text = line;
paragraphTexts.Add(text);
line = "";
lastY += 40;
}
}
else
{
paragraphTexts.Add(text);
line = " "+paragraphs[i][e];
lastY += 27;
}
}
}
}
}
public override void OnShowFinish()
@@ -247,6 +301,15 @@ namespace Vocaluxe.Screens
_CreditNames[i].particle.Draw();
}
}
//Draw Text
if (TextTimer.IsRunning)
{
for (int i = 0; i < paragraphTexts.Count; i++)
{
paragraphTexts[i].Draw();
}
}
return true;
}
@@ -347,12 +410,13 @@ namespace Vocaluxe.Screens
//Check, if last name is set to false
if (i == _CreditNames.Count - 1)
{
//Will later fade to Main-Screen
active = false;
//Stop and reset timer for next time
CreditsTimer.Stop();
CreditsTimer.Reset();
//Start Text-Timer
TextTimer.Start();
active = true;
}
}
break;
@@ -361,6 +425,18 @@ namespace Vocaluxe.Screens
}
}
if (TextTimer.IsRunning)
{
if (TextTimer.ElapsedMilliseconds > 10000)
{
active = false;
}
else
{
active = true;
}
}
return active;
}
}