Gonzo.Elements.UIElement.IsMouseOver C# (CSharp) 메소드

IsMouseOver() 공개 메소드

Returns true if the mouse is over this UIElement. Does NOT work for pixel-perfect collision.
public IsMouseOver ( InputHelper Input ) : bool
Input InputHelper
리턴 bool
        public virtual bool IsMouseOver(InputHelper Input)
        {
            if (m_Size != null)
            {
                if (Input.MousePosition.X > m_Position.X && Input.MousePosition.X <= (m_Position.X + m_Size.X))
                {
                    if (Input.MousePosition.Y > m_Position.Y && Input.MousePosition.Y <= (m_Position.Y + m_Size.Y))
                        return true;
                }
            }
            else
            {
                if (Input.MousePosition.X > m_Position.X && Input.MousePosition.X <= (m_Position.X + Image.Texture.Width))
                {
                    if (Input.MousePosition.Y > m_Position.Y && Input.MousePosition.Y <= (m_Position.Y + Image.Texture.Height))
                        return true;
                }
            }

            return false;
        }