Пример #1
0
        public override void Update(GameTime gameTime)
        {
            if (ControlManager.CheckKeyPress(Keys.Escape))
            {
                // MAC CHANGE
                Game.GameStarted = false;
                Game.Restart(false);
            }

            if (scrolling)
            {
                UpdateScrolling(gameTime);
            }
            else
            {
                if (textTimer % 5 == 0 &&
                    text.Count > 0)
                {
                    bool temp;
                    currentLine = TextUtils.ScrollText(text[0], false, out temp);
                }

                UpdateFading(gameTime);
            }

            textBox.Update(gameTime);
        }
Пример #2
0
 public void Update(GameTime gameTime)
 {
     if (textBuffer != null)
     {
         if (useScrolling && !scrollingFinished)
         {
             text = TextUtils.WordWrap(spriteFont,
                                       TextUtils.ScrollText(textBuffer,
                                                            flushScrollText,
                                                            out scrollingFinished),
                                       textBoxRect.Width);
         }
         else if (scrollingFinished)
         {
             TextUtils.RefreshTextScrollBuffer();
         }
         else
         {
             text = TextUtils.WordWrap(spriteFont, textBuffer, textBoxRect.Width);
         }
     }
 }
Пример #3
0
        public override void Update(GameTime gameTime, Vector2 canvasPosition)
        {
            base.Update(gameTime, canvasPosition);

            if (textBuffer.Count > 0)
            {
                if (useScrolling)
                {
                    text = TextUtils.WordWrap(font,
                                              TextUtils.ScrollText(textBuffer[0],
                                                                   flushScrollingText,
                                                                   out textScrollingFinished),
                                              containerWidth);
                }
                else
                {
                    text = TextUtils.WordWrap(font,
                                              textBuffer[0],
                                              containerWidth);
                }
            }
        }