/// <summary>
        /// Draw the description of the selected item.
        /// </summary>
        protected override void DrawSelectedDescription(Spell entry)
        {
            // check the parameter
            if (entry == null)
            {
                throw new ArgumentNullException("entry");
            }

            SpriteBatch spriteBatch = ScreenManager.SpriteBatch;
            Vector2     position    = descriptionTextPosition;

            // draw the insufficient-mp warning
            if (CombatEngine.IsActive && (entry.MagicPointCost > statistics.MagicPoints))
            {
                // draw the insufficient-mp warning
                spriteBatch.DrawString(Fonts.DescriptionFont,
                                       "Not enough MP to Cast Spell", position,
                                       Color.Red);

                position.X += Fonts.DescriptionFont.MeasureString("Not enough MP to Cast Spell").X + 5;
            }

            // draw the description
            spriteBatch.DrawString(Fonts.DescriptionFont,
                                   Fonts.BreakTextIntoLines(entry.Description, 90, 3),
                                   position, Fonts.DescriptionColor);
        }
Exemple #2
0
        /// <summary>
        /// Loads graphics content for this screen. This uses the shared ContentManager
        /// provided by the Game class, so the content will remain loaded forever.
        /// Whenever a subsequent MessageBoxScreen tries to load this same content,
        /// it will just get back another reference to the already loaded data.
        /// </summary>
        public override void LoadContent()
        {
            ContentManager content = ScreenManager.Game.Content;

            backgroundTexture   = content.Load <Texture2D>(@"Textures\MainMenu\Confirm");
            backTexture         = content.Load <Texture2D>(@"Textures\Buttons\rpgbtn");
            selectTexture       = content.Load <Texture2D>(@"Textures\Buttons\rpgbtn");
            loadingBlackTexture =
                content.Load <Texture2D>(@"Textures\GameScreens\FadeScreen");

            Viewport viewport = ScreenManager.GraphicsDevice.Viewport;

            backgroundPosition = new Vector2(
                (viewport.Width - (backgroundTexture.Width * ScaledVector2.DrawFactor)) / 2,
                (viewport.Height - (backgroundTexture.Height * ScaledVector2.DrawFactor)) / 2);
            loadingBlackTextureDestination = new Rectangle(viewport.X, viewport.Y,
                                                           viewport.Width, viewport.Height);

            backPosition = backgroundPosition + new Vector2(20f,
                                                            backgroundTexture.Height * ScaledVector2.DrawFactor - 110 * ScaledVector2.ScaleFactor);
            selectPosition = backgroundPosition + new Vector2(
                backgroundTexture.Width * ScaledVector2.DrawFactor - 200 * ScaledVector2.ScaleFactor,
                backgroundTexture.Height * ScaledVector2.DrawFactor - 110 * ScaledVector2.ScaleFactor);

            confirmPosition.X = backgroundPosition.X + (backgroundTexture.Width * ScaledVector2.DrawFactor -
                                                        Fonts.HeaderFont.MeasureString("Confirmation").X) / 2f;
            confirmPosition.Y = backgroundPosition.Y + 47 * ScaledVector2.ScaleFactor;

            message           = Fonts.BreakTextIntoLines(message, 36, 10);
            messagePosition.X = backgroundPosition.X + (int)((backgroundTexture.Width * ScaledVector2.DrawFactor -
                                                              Fonts.GearInfoFont.MeasureString(message).X) / 2);
            messagePosition.Y = (backgroundPosition.Y * 2) - 20 * ScaledVector2.ScaleFactor;
        }
Exemple #3
0
        /// <summary>
        /// Draw the screen.
        /// </summary>
        public override void Draw(GameTime gameTime)
        {
            SpriteBatch spriteBatch = ScreenManager.SpriteBatch;

            // Draw Shop Main Menu
            spriteBatch.Begin();

            // Draw Shop Main Menu Screen
            DrawMainMenu();

            // Draw Buttons
            if (IsActive)
            {
                DrawButtons();
            }

            // Measure Title of the Screen


            spriteBatch.Draw(plankTexture, plankPosition, Color.White);

            // Draw the Title of the Screen
            spriteBatch.DrawString(Fonts.HeaderFont, store.Name,
                                   shopNamePosition, Fonts.TitleColor);

            // Draw Conversation Strip
            spriteBatch.Draw(conversationStrip, conversationStripPosition,
                             Color.White);

            // Draw Shop Keeper
            spriteBatch.Draw(store.ShopkeeperTexture, shopKeeperPosition, Color.White);

            // Draw Shop Info
            spriteBatch.DrawString(Fonts.DescriptionFont,
                                   Fonts.BreakTextIntoLines(store.WelcomeMessage, 55, 3),
                                   welcomeMessagePosition, Fonts.DescriptionColor);

            spriteBatch.End();
        }