Exemplo n.º 1
0
        /// <summary>
        /// Draws player information.
        /// </summary>
        private void DrawPlayerDetails()
        {
            SpriteBatch spriteBatch = ScreenManager.SpriteBatch;

            if (player != null)
            {
                currentTextPosition.X = playerTextPosition.X;
                currentTextPosition.Y = playerTextPosition.Y;

                // Current Level
                spriteBatch.DrawString(Fonts.DescriptionFont, "Level: " +
                                       player.CharacterLevel,
                                       currentTextPosition, Color.Black);

                // Health Points
                currentTextPosition.Y += intervalBetweenEachInfo;
                spriteBatch.DrawString(Fonts.DescriptionFont, "Health Points: " +
                                       player.CurrentStatistics.HealthPoints + "/" +
                                       player.CharacterStatistics.HealthPoints,
                                       currentTextPosition, Color.Black);

                // Magic Points
                currentTextPosition.Y += intervalBetweenEachInfo;
                spriteBatch.DrawString(Fonts.DescriptionFont, "Magic Points: " +
                                       player.CurrentStatistics.MagicPoints + "/" +
                                       player.CharacterStatistics.MagicPoints,
                                       currentTextPosition, Color.Black);

                // Experience Details
                currentTextPosition.Y += intervalBetweenEachInfo;
                if (player.IsMaximumCharacterLevel)
                {
                    spriteBatch.DrawString(Fonts.DescriptionFont, "Experience: Maximum",
                                           currentTextPosition, Color.Black);
                }
                else
                {
                    spriteBatch.DrawString(Fonts.DescriptionFont, "Experience: " +
                                           player.Experience + "/" +
                                           player.ExperienceForNextLevel,
                                           currentTextPosition, Color.Black);
                }

                DrawEquipmentInfo(player);

                DrawModifiers(player);

                DrawEquipmentStatistics(player);

                if (player == null)
                {
                    DrawPlayerCount();
                }
            }
            // Draw Gold
            spriteBatch.DrawString(Fonts.ButtonNamesFont,
                                   Fonts.GetGoldString(Session.Party.PartyGold), goldPosition,
                                   Color.White);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Draw the party gold text.
        /// </summary>
        protected virtual void DrawPartyGold()
        {
            if (!IsActive)
            {
                return;
            }

            SpriteBatch spriteBatch = ScreenManager.SpriteBatch;

            spriteBatch.Draw(goldTexture, goldTexturePosition, Color.White);
            spriteBatch.DrawString(Fonts.ButtonNamesFont,
                                   Fonts.GetGoldString(Session.Party.PartyGold), goldTextPosition,
                                   Color.White);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Draw the party gold text.
        /// </summary>
        protected virtual void DrawPartyGold()
        {
            if (!IsActive)
            {
                return;
            }

            SpriteBatch spriteBatch = ScreenManager.SpriteBatch;

            spriteBatch.Draw(goldTexture, goldTexturePosition, null, Color.White, 0f,
                             Vector2.Zero, ScaledVector2.DrawFactor, SpriteEffects.None, 0f);
            spriteBatch.DrawString(Fonts.ButtonNamesFont,
                                   Fonts.GetGoldString(Session.Party.PartyGold), goldTextPosition,
                                   Color.White);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Draws the buttons.
        /// </summary>
        private void DrawButtons()
        {
            if (!IsActive)
            {
                return;
            }

            SpriteBatch spriteBatch = ScreenManager.SpriteBatch;

            // Draw Gold Text
            spriteBatch.DrawString(Fonts.ButtonNamesFont,
                                   Fonts.GetGoldString(Session.Party.PartyGold), partyGoldPosition,
                                   Color.White);

            // Draw Gold Icon
            spriteBatch.Draw(goldIcon, goldIconPosition, null, Color.White, 0f,
                             Vector2.Zero, ScaledVector2.DrawFactor, SpriteEffects.None, 0f);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Draws the buttons.
        /// </summary>
        private void DrawButtons()
        {
            if (!IsActive)
            {
                return;
            }

            SpriteBatch spriteBatch = ScreenManager.SpriteBatch;

            Vector2 position = new Vector2();

            // Draw Back Button
            spriteBatch.Draw(backButton, backButtonPosition, Color.White);

            // Draw Back Text
            position    = backButtonPosition;
            position.X += backButton.Width + 10;
            position.Y += 5;
            spriteBatch.DrawString(Fonts.ButtonNamesFont, "Back", position, Color.White);

            // Draw Select Button
            spriteBatch.Draw(selectButton, selectButtonPosition, Color.White);

            // Draw Select Text
            position    = selectButtonPosition;
            position.X -= placeTextMid.X + 10;
            position.Y += 5;
            spriteBatch.DrawString(Fonts.ButtonNamesFont, "Select", position,
                                   Color.White);

            // Draw Gold Text
            spriteBatch.DrawString(Fonts.ButtonNamesFont,
                                   Fonts.GetGoldString(Session.Party.PartyGold), partyGoldPosition,
                                   Color.White);

            // Draw Gold Icon
            spriteBatch.Draw(goldIcon, goldIconPosition, Color.White);
        }
        /// <summary>
        ///  Draw the screen.
        /// </summary>
        public override void Draw(GameTime gameTime)
        {
            Vector2 currentIconPosition = iconPosition;
            Vector2 currentTextPosition = textPosition;
            Vector2 currentlinePosition = linePosition;

            switch (mode)
            {
            case RewardScreenMode.Quest:
                titleText = "Quest Complete";
                break;

            case RewardScreenMode.Combat:
                titleText = "Combat Won";
                break;
            }
            titlePosition.X = (screenSize.X -
                               Fonts.HeaderFont.MeasureString(titleText).X) / 2;
            titlePosition.Y = backgroundPosition.Y + lineSpacing;

            SpriteBatch spriteBatch = ScreenManager.SpriteBatch;

            spriteBatch.Begin();

            // Draw the fading screen
            spriteBatch.Draw(fadeTexture, fadeDest, Color.White);

            // Draw the popup background
            spriteBatch.Draw(backTexture, backgroundPosition, Color.White);

            // Draw the title
            spriteBatch.DrawString(Fonts.HeaderFont, titleText, titlePosition,
                                   Fonts.TitleColor);

            // Draw the experience points awarded
            spriteBatch.DrawString(Fonts.GearInfoFont,
                                   "XP Awarded :        " + experienceReward,
                                   xpAwardPosition, Fonts.CountColor);

            // Draw the gold points awarded
            spriteBatch.DrawString(Fonts.GearInfoFont,
                                   "Gold Awarded :      " + Fonts.GetGoldString(goldReward),
                                   goldAwardPosition, Fonts.CountColor);

            // Draw the items awarded
            spriteBatch.DrawString(Fonts.GearInfoFont, "Items Awarded :",
                                   itemAwardPosition, Fonts.CountColor);

            // Draw horizontal divider lines
            for (int i = 0; i <= maxLines; i++)
            {
                spriteBatch.Draw(lineTexture, currentlinePosition, Color.White);
                currentlinePosition.Y += lineSpacing;
            }

            // Draw the item details
            for (int i = startIndex; i < endIndex; i++)
            {
                // Draw the item icon
                gearReward[i].DrawIcon(ScreenManager.SpriteBatch, currentIconPosition);

                // Draw the item name
                spriteBatch.DrawString(Fonts.GearInfoFont,
                                       gearReward[i].Name, currentTextPosition, Fonts.CountColor);

                // Increment the position to the next line
                currentTextPosition.Y += lineSpacing;
                currentIconPosition.Y += lineSpacing;
            }
            // Draw the scroll buttons
            spriteBatch.Draw(scrollUpTexture, scrollUpPosition, Color.White);
            spriteBatch.Draw(scrollDownTexture, scrollDownPosition, Color.White);

            // Draw the select button and its corresponding text
            spriteBatch.Draw(selectIconTexture, selectIconPosition, Color.White);
            spriteBatch.DrawString(Fonts.ButtonNamesFont, selectString, selectPosition,
                                   Color.White);
            spriteBatch.End();
        }
Exemplo n.º 7
0
        /// <summary>
        /// Draw the screen.
        /// </summary>
        public override void Draw(GameTime gameTime)
        {
            SpriteBatch spriteBatch    = ScreenManager.SpriteBatch;
            Vector2     dialogPosition = informationPosition;

            spriteBatch.Begin();

            // Draw fade screen
            spriteBatch.Draw(fadeTexture, screenRectangle, Color.White);

            // Draw the background
            spriteBatch.Draw(backgroundTexture, backgroundPosition, null, Color.White, 0f,
                             Vector2.Zero, ScaledVector2.DrawFactor, SpriteEffects.None, 0f);
            // Draw the wooden plank
            spriteBatch.Draw(plankTexture, plankPosition, null, Color.White, 0f,
                             Vector2.Zero, ScaledVector2.DrawFactor, SpriteEffects.None, 0f);
            // Draw the inn name on the wooden plank
            spriteBatch.DrawString(Fonts.HeaderFont, inn.Name, namePosition,
                                   Fonts.DisplayColor);

            // Draw the stay and leave option texts based on the current selection
            if (selectionMark == 1)
            {
                spriteBatch.Draw(highlightTexture, stayHighlightPosition, null, Color.White, 0f,
                                 Vector2.Zero, ScaledVector2.DrawFactor, SpriteEffects.None, 0f);
                spriteBatch.Draw(arrowTexture, stayArrowPosition, null, Color.White, 0f,
                                 Vector2.Zero, ScaledVector2.DrawFactor, SpriteEffects.None, 0f);
                spriteBatch.DrawString(
                    Fonts.GearInfoFont, stayString, stayPosition, Fonts.HighlightColor,
                    0f, Vector2.Zero, 1.5f, SpriteEffects.None, 0f);
                spriteBatch.DrawString(
                    Fonts.GearInfoFont, leaveString, leavePosition, Fonts.DisplayColor,
                    0f, Vector2.Zero, 1.5f, SpriteEffects.None, 0f);
            }
            else
            {
                spriteBatch.Draw(highlightTexture, leaveHighlightPosition, null, Color.White, 0f,
                                 Vector2.Zero, ScaledVector2.DrawFactor, SpriteEffects.None, 0f);
                spriteBatch.Draw(arrowTexture, leaveArrowPosition, null, Color.White, 0f,
                                 Vector2.Zero, ScaledVector2.DrawFactor, SpriteEffects.None, 0f);
                spriteBatch.DrawString(Fonts.GearInfoFont, stayString, stayPosition,
                                       Fonts.DisplayColor, 0f, Vector2.Zero, 1.5f, SpriteEffects.None, 0f);
                spriteBatch.DrawString(Fonts.GearInfoFont, leaveString, leavePosition,
                                       Fonts.HighlightColor, 0f, Vector2.Zero, 1.5f, SpriteEffects.None, 0f);
            }
            // Draw the amount of gold
            spriteBatch.DrawString(Fonts.ButtonNamesFont,
                                   Fonts.GetGoldString(Session.Party.PartyGold), goldStringPosition,
                                   Color.White);

            // Draw Conversation Strip
            spriteBatch.Draw(conversationTexture, conversationStripPosition, null, Color.White, 0f,
                             Vector2.Zero, ScaledVector2.DrawFactor, SpriteEffects.None, 0f);

            // Draw Shop Keeper
            spriteBatch.Draw(inn.ShopkeeperTexture, innKeeperPosition, null, Color.White, 0f,
                             Vector2.Zero, ScaledVector2.DrawFactor, SpriteEffects.None, 0f);
            // Draw the cost to stay
            costString = "Cost: " + GetChargeForParty(Session.Party) + " Gold";
            spriteBatch.DrawString(Fonts.DescriptionFont, costString, costPosition,
                                   Color.DarkRed);
            // Draw the innkeeper dialog
            for (int i = 0; i < endIndex; i++)
            {
                spriteBatch.DrawString(Fonts.DescriptionFont, currentDialogue[i],
                                       dialogPosition, Color.Black);
                dialogPosition.Y += Fonts.DescriptionFont.LineSpacing;
            }

            // Draw Gold Icon
            spriteBatch.Draw(goldIcon, goldIconPosition, null, Color.White, 0f,
                             Vector2.Zero, ScaledVector2.DrawFactor, SpriteEffects.None, 0f);

            spriteBatch.End();
        }