コード例 #1
0
        //Metod för utritning av muspekare
        internal void DrawMouse()
        {
            Vector2 mousePosition = new Vector2(m_inputHandler.GetMouseState().X, m_inputHandler.GetMouseState().Y);

            if (!m_inputHandler.MouseIsOverEnemy)
            {
                if (m_inputHandler.LeftButtonIsDown())
                {
                    m_spriteBatch.Draw(m_mouseTextures[1], mousePosition, Color.White);
                }
                else
                {
                    m_spriteBatch.Draw(m_mouseTextures[0], mousePosition, Color.White);
                }
            }
        }
コード例 #2
0
        /// <summary>
        /// Method for drawing the mouse cursor
        /// </summary>
        private void DrawMouse()
        {
            Vector2 mousePosition = new Vector2(_inputHandler.GetMouseState().X, _inputHandler.GetMouseState().Y);
            Color   mouseColor    = Color.White;

            if (_inputHandler.MouseIsOverLoot && !_inputHandler.MouseIsOverEnemy)
            {
                mouseColor = Color.LightGreen;
            }
            if (_inputHandler.MouseIsOverEnemy)
            {
                _spriteBatch.Draw(GetTexture(Texture.CURSOR_HOVER_ENEMY), mousePosition, mouseColor);
            }
            else if (_inputHandler.LeftButtonIsDown())
            {
                _spriteBatch.Draw(GetTexture(Texture.CURSOR_SELECT), mousePosition, mouseColor);
            }
            else
            {
                _spriteBatch.Draw(GetTexture(Texture.CURSOR_NORMAL), mousePosition, mouseColor);
            }
        }
コード例 #3
0
        //Metod för utritning av muspekaren
        private void DrawMouse()
        {
            Vector2 mousePosition = new Vector2(m_inputHandler.GetMouseState().X, m_inputHandler.GetMouseState().Y);
            Color   mouseColor    = Color.White;

            if (m_inputHandler.MouseIsOverLoot && !m_inputHandler.MouseIsOverEnemy)
            {
                mouseColor = Color.LightGreen;
            }

            if (m_inputHandler.MouseIsOverEnemy)
            {
                m_spriteBatch.Draw(m_textures[CURSOR_HOVER_ENEMY], mousePosition, mouseColor);
            }
            else if (m_inputHandler.LeftButtonIsDown())
            {
                m_spriteBatch.Draw(m_textures[CURSOR_SELECT], mousePosition, mouseColor);
            }
            else
            {
                m_spriteBatch.Draw(m_textures[CURSOR_NORMAL], mousePosition, mouseColor);
            }
        }