Ejemplo n.º 1
0
        /// <summary>
        /// draw the dialogue box
        /// </summary>
        public void Draw()
        {
            if (isActive)
            {
                ScreenManager.SpriteBatch.Begin();

                ScreenManager.SpriteBatch.Draw(box, boxLocation, Color.Gray);
                ScreenManager.SpriteBatch.Draw(currentPortrait, portraitLocation, Color.White);

                ScreenManager.SpriteBatch.DrawString(ScreenManager.ExtraSmallFont,
                                                     TextTools.WrapText(ScreenManager.ExtraSmallFont, currentDialogue, 280),
                                                     new Vector2(boxLocation.X + 140, boxLocation.Y + 8),
                                                     textColors[Index]);

                ScreenManager.SpriteBatch.DrawString(ScreenManager.ExtraSmallFont,
                                                     whoTalking[Index],
                                                     TextTools.CenterTextWithinRect(whoTalking[Index],
                                                                                    ScreenManager.ExtraSmallFont,
                                                                                    new Rectangle((int)boxLocation.X + 1, (int)boxLocation.Y + 130, 128, 34)),
                                                     Color.White);

                ScreenManager.SpriteBatch.DrawString(ScreenManager.ExtraSmallFont, "Press any key to continue...",
                                                     new Vector2(boxLocation.X + 140, boxLocation.Y + 135),
                                                     Color.White);

                ScreenManager.SpriteBatch.End();
            }
        }
Ejemplo n.º 2
0
Archivo: Button.cs Proyecto: hvak/Below
        /// <summary>
        /// set location
        /// </summary>
        /// <param name="x"></param>
        /// <param name="y"></param>
        public void Location(int x, int y)
        {
            position.X = x;
            position.Y = y;

            Vector2 size = font.MeasureString(text);

            textPos = TextTools.CenterTextWithinRect(text, font, new Rectangle(position.X, position.Y, buttonTexture.Width, buttonTexture.Height));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// draw text and update timer
        /// </summary>
        /// <param name="gameTime"></param>
        public override void DrawOverLighting(GameTime gameTime)
        {
            //fade out
            if (col.A > 0)
            {
                col *= .99f;
            }


            ScreenManager.SpriteBatch.Begin();

            ScreenManager.SpriteBatch.Draw(report, Vector2.Zero, Color.White);

            ScreenManager.SpriteBatch.DrawString(ScreenManager.SmallFont, "Press any key to continue...", TextTools.CenterTextWithinRect("Press any key to continue...", ScreenManager.SmallFont, new Rectangle(0, 0, 1280, 170)), Color.White);

            ScreenManager.SpriteBatch.Draw(overlay, new Rectangle(0, 0, 1280, 960), col);

            ScreenManager.SpriteBatch.End();

            base.Draw(gameTime);
        }