Esempio n. 1
0
        public void Draw(SpriteBatch spriteBatch)
        {
            MouseState mouseState = Mouse.GetState();

            string currentXP = _player.GetExperiencePoints().ToString();
            string maximumXP = _player.GetMaxExperiencePoints().ToString();

            int screenMouseX = mouseState.X;
            int screenMouseY = mouseState.Y;

            Vector2 mouseVectorScreen = new Vector2(screenMouseX, screenMouseY);
            Vector2 mouseVectorWorld  = JustCombat.WorldCamera.ScreenToWorld(mouseVectorScreen);

            int worldMouseX = (int)(mouseVectorWorld.X);
            int worldMouseY = (int)(mouseVectorWorld.Y);

            string target = JustCombat.TargetingSystem.ToString();

            // TODO: Need to keep this entire class and elements fixed to screen coords...
            //OrthographicCamera camera = JustCombat.WorldCamera;

            spriteBatch.Draw(_topBarBackpanel, new Vector2(0.0f, 0.0f), Color.White);
            spriteBatch.Draw(_actionBarPanel, new Vector2(((Constants.SCREEN_WIDTH / 2) - (_actionBarPanel.Width / 2)), (Constants.SCREEN_HEIGHT - _actionBarPanel.Height)), Color.White);

            int _counter = 324;

            for (int i = 0; i < actionKeys.Length; i++)
            {
                string text = actionKeys[i];

                spriteBatch.DrawString(_fontCandara10, text, new Vector2(_counter, 729), Color.White);

                _counter = _counter + 52;
            }

            if (_player.GetLevel() < Constants.MAXIMUM_PLAYER_LEVEL)
            {
                spriteBatch.Draw(_xpBarFrame, new Vector2(282, 703), Color.White);
                _experienceBar.Draw(spriteBatch);
                spriteBatch.DrawString(_fontCandara10, "XP   " + currentXP + " / " + maximumXP, new Vector2(560, 705), Color.White);
            }

            _playerInfoCard.Draw(spriteBatch);

            if (_target != null)
            {
                _targetInfoCard.Draw(spriteBatch);
            }

            if (InventoryPanel.IsDisplayed())
            {
                InventoryPanel.Draw(spriteBatch);
            }

            if (CharacterPanel.IsDisplayed())
            {
                CharacterPanel.Draw(spriteBatch);
            }

            if (_cursorInfoPanel.IsDisplayed())
            {
                _cursorInfoPanel.Draw(spriteBatch);
            }

            if (_debug)
            {
                spriteBatch.DrawString(_fontConsolas13, DateTime.Now.ToString(), new Vector2(500.0f, 10.0f), Color.White);
                spriteBatch.DrawString(_fontConsolas13, "X: " + _player.GetX() + ", Y: " + _player.GetY(), new Vector2(500.0f, 30.0f), Color.White);
                //spriteBatch.DrawString(_fontConsolas13, "empty3: ", new Vector2(500.0f, 50.0f), Color.White);
                spriteBatch.DrawString(_fontConsolas13, target, new Vector2(500.0f, 70.0f), Color.White);

                //spriteBatch.DrawString(_font, "CD: " + CoolDownTimer.ToString(), new Vector2(550.0f, 50.0f), Color.White);

                spriteBatch.DrawString(_fontConsolas13, "Visible Actors: " + _actorList.Count.ToString(), new Vector2(730.0f, 10.0f), Color.White);
                //spriteBatch.DrawString(_fontConsolas13, "empty2: ", new Vector2(730.0f, 30.0f), Color.White);
                //spriteBatch.DrawString(_fontConsolas13, "empty3: ", new Vector2(730.0f, 50.0f), Color.White);
                //spriteBatch.DrawString(_fontConsolas13, "empty4: ", new Vector2(730.0f, 70.0f), Color.White);

                //spriteBatch.DrawString(_font, "Health " + _player.GetHitPoints().ToString() + " / " + _player.GetMaxHitPoints().ToString(), new Vector2(744.0f, 6.0f), Color.White);
                spriteBatch.DrawString(_fontConsolas13, "   Player State: " + _player.GetState().ToString(), new Vector2(950.0f, 10.0f), Color.White);
                spriteBatch.DrawString(_fontConsolas13, "HealthBar State: " + _player.GetHealthBarState().ToString(), new Vector2(950.0f, 30.0f), Color.White);
                spriteBatch.DrawString(_fontConsolas13, "        Heading: " + _player.GetDirection().GetHeading().ToString(), new Vector2(950.0f, 50.0f), Color.White);
                spriteBatch.DrawString(_fontConsolas13, "  Taking Damage: " + _player._takingDamage.ToString(), new Vector2(950.0f, 70.0f), Color.White);

                spriteBatch.DrawString(_fontConsolas13, "Screen Mouse: (" + screenMouseX + "," + screenMouseY + ")", new Vector2(screenMouseX + 50, screenMouseY + 50), Color.White);
                spriteBatch.DrawString(_fontConsolas13, " World Mouse: (" + worldMouseX + "," + worldMouseY + ")", new Vector2(screenMouseX + 50, screenMouseY + 70), Color.White);

                ScrollTransformBounds.Draw(spriteBatch);
                ViewContainerBounds.Draw(spriteBatch);
            }

            spriteBatch.Draw(Cursor, _cursorPosition, Color.White);
        }