public IntroManager(SpriteFont _font,SpriteFont _fontB, int _world, int _level) { font = _font; fontB = _fontB; world = _world; level = _level; textBoxCount = LevelDataManager.levelData[world, level].textBox.Count; textHeight = (int)(font.MeasureString("A").Y * 3) + (buffer * 2); if (!LevelDataManager.levelData[world, level].isIntro) introFinished = true; LevelDataManager.UItextures.TryGetValue("Pixel", out pixel); LevelDataManager.UItextures.TryGetValue("PearStache", out stache); LevelDataManager.UItextures.TryGetValue("Cursor", out cursor); LevelDataManager.UItextures.TryGetValue("A", out A); LevelDataManager.UItextures.TryGetValue("B", out B); halfW = Camera.ViewportWidth / 2; if (!introFinished) { SetSpeaker(); textBox = new TextBox(LevelDataManager.levelData[world, level].textBox[textBoxIndex], font, pixel, Color.White * 0.3f, new Rectangle((int)textBoxPos.X, (int)textBoxPos.Y, Camera.ViewportWidth - 256, textHeight), buffer, speakerOffset); cursorPos = LevelDataManager.levelData[world, level].cursor[textBoxIndex]; lookPos = LevelDataManager.levelData[world, level].look[textBoxIndex]; if (lookPos == Vector2.Zero) lookPos = cursorPos; if (lookPos == Vector2.Zero) lookPos = new Vector2(0, Camera.WorldRectangle.Height - Camera.ViewportHeight/2); Camera.ScrollTo(lookPos,0); } }
public void AisPressed() { if (!textBox.isFinished) { textBox.finishNow = true; } else { textBoxIndex += 1; if (textBoxIndex >= textBoxCount) transitionOut = true; else { SetSpeaker(); textBox = new TextBox(LevelDataManager.levelData[world, level].textBox[textBoxIndex], font, pixel, Color.White * 0.3f, new Rectangle(128, 196, Camera.ViewportWidth - 256, textHeight), buffer, speakerOffset); cursorPos = LevelDataManager.levelData[world, level].cursor[textBoxIndex]; lookPos = LevelDataManager.levelData[world, level].look[textBoxIndex]; if (lookPos == Vector2.Zero) lookPos = cursorPos; if (lookPos == Vector2.Zero) lookPos = new Vector2(0, Camera.WorldRectangle.Height - Camera.ViewportHeight/2); Camera.ScrollTo(lookPos, 0); } } }