void ShowTooltip(Rect rect, string content, Vector2 scrollOffset)
        {
            TooltipContent c = TooltipContent.TempContent;

            c.summary = content;
            ShowTooltip(rect, c, scrollOffset);
        }
示例#2
0
        public void ShowInternal(Rect rect, TooltipContent content)
        {
            this.content = content;
            Vector2 size = content.CalcSize();

            var dpiRatio    = Screen.dpi / 96f;
            var screenWidth = Screen.currentResolution.width / dpiRatio;

            Vector2 p = new Vector2(rect.x + rect.width + k_PositionPadding, rect.y);

            if ((p.x + size.x) > screenWidth)
            {
                p.x = rect.x - k_PositionPadding - size.x;
            }

            minSize = size;
            maxSize = size;
            var newPosition = new Rect(
                p.x,
                p.y,
                size.x,
                size.y);

            if (position != newPosition)
            {
                position     = newPosition;
                s_WindowRect = new Rect(0, 0, size.x, size.y);
            }
        }
示例#3
0
        void ShowTooltip(Rect rect, TooltipContent content, Vector2 scrollOffset)
        {
            Rect buttonRect = new Rect(
                (window.position.x + rect.x) - scrollOffset.x,
                (window.position.y + rect.y) - scrollOffset.y,
                rect.width,
                rect.height);

            TooltipEditor.Show(buttonRect, content);
        }
示例#4
0
        public void ShowInternal(Rect rect, TooltipContent content)
        {
            this.content = content;

            Vector2 size = content.CalcSize();

            Vector2 p = new Vector2(rect.x + rect.width + k_PositionPadding, rect.y);

            // if(p.x > Screen.width) p.x = rect.x - POSITION_PADDING - size.x;

            this.minSize = size;
            this.maxSize = size;

            this.position = new Rect(
                p.x,
                p.y,
                size.x,
                size.y);

            s_WindowRect = new Rect(0, 0, size.x, size.y);
        }
        public void ShowInternal(Rect rect, TooltipContent content)
        {
            this.content = content;
            Vector2 size = content.CalcSize();

            Vector2 p = new Vector2(rect.x + rect.width + k_PositionPadding, rect.y);

            if (((p.x % Screen.currentResolution.width) + size.x) > Screen.currentResolution.width)
            {
                p.x = rect.x - k_PositionPadding - size.x;
            }

            minSize = size;
            maxSize = size;

            position = new Rect(
                p.x,
                p.y,
                size.x,
                size.y);

            s_WindowRect = new Rect(0, 0, size.x, size.y);
        }
 public static void Show(Rect rect, TooltipContent content)
 {
     instance().ShowInternal(rect, content);
 }