The CinematicManager will be used to cycle through still images which describe plot events and advance the story. These cinematics will primarily occur at the beginning of a level, after loading and before gameplay. Paraphrased, once the cinematic is set to on, the update loop will display textures from an array, and advance to the next frame, array slot, after a input from the user. Text is displayed for each frame, one letter at a time. This step can be skipped, through user input, which then displays the whole text block. There will be one cinematic that plays at the end of the final level. Once that cinematic is complete, it will go to the menu state.


  • Window : The CinematicManager is created by the Window
  • Loader : The CinematicManager will get the list of slides from the Loader


  • bool isPlaying - is the cinematic currently playing?
  • bool isTyping - is the cinematic in typing mode?
  • float fontSize - Zoom factor of font, size
  • float lineLength - Maxinum width of text, in pixels
  • int currentFrame - index of the current frame in stillArray
  • int currentLetter - index of current letter in text string
  • int letterTimer - counter to keep track of when duration is up
  • int letterDuration - wait between printing each letter
  • string text - current string of text/dialogue
  • List<string> textArray - text, one string for each frame
  • List<Texture2D> stillArray - stills as Texture2Ds, one for each frame
  • SpriteBatch spriteBatch - SpriteBatch, used for drawing
  • SpriteFont font - font used to print text
  • Vector2 textPosition - Position of text on screen (x,y)


  • Update
    • Updates the output string, by appending chars from the string of the textArray
  • Next
    • Advances to the next frame. The Window class sets up a input delegate so that this method is called when the player presses the A button.
  • Reset
    • Resets the cinematic for the next frame
  • Draw
    • Draws the image and text onto the screen
  • Done
    • When the cinematic is done, it will tell the Window to go to the gameplay state
  • SetCinematic
    • stills and the text are set by whats passed in. After the Loader loads in a xml it will call this method passing in the cinematic data
  • ShowFullText
    • Shows the full body of text, called when typing is skipped by the user
  • WordWrap
    • Constrains the output string to its length limit and, if necessary, moves words to the next line
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License