Author Topic: [Request] Better Tooltip controls  (Read 2418 times)

konsnos

  • Newbie
  • *
  • Thank You
  • -Given: 8
  • -Receive: 0
  • Posts: 26
    • View Profile
[Request] Better Tooltip controls
« on: August 25, 2014, 10:22:45 AM »
Hello ArenMook. I've been using NGUI for a lot of time now, and the more I used it the better I understand it. It's really top and must-have for Unity3D and IMO better than uGUI so far.
But I have a few requests about the tooltip which I feel is undervalued in the whole package.

Follow mouse - Sometimes it shows up in totally bad places and I want to move it out. If the tooltip follows the mouse it would be highly convenient. Many times in games which have this feature I move it in the best possible place to watch the game but in parallel read the tooltip (eg. an ability which I want to better understand or the updated stats of my units in Rome Total War)
Multiple Text sizes - Example: Title and the description of an item. Things in parenthesis, and other stuff. I know I can set a tooltip with many UILabels to achieve this but it is not straightforward (in fact a bit hard, and adding more than one tooltips needs some tweaking), but it would be more convenient to be able to do it in one UILabel.
Better Pivot Point Controls - Currently it's top left. If I change it it's messed up and it needs some love in the script to make it work again. It should just work.
Appear Delay - Very useful. Best implemented at function ShowText, so that each element may have its own delay. I've created a coroutine to handle this, which was fairly easy, but after each update of NGUI I must copy-paste my changes.

Just wanted to drop my thoughts.  :) Your GUI rocks! Cheers.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: [Request] Better Tooltip controls
« Reply #1 on: August 26, 2014, 02:16:44 AM »
Tooltip option to follow the mouse is a useful one. I'll prototype it in Windward in a bit.

Multiple text sizes... you can already achieve this just by using multiple labels in your tooltip. I'm doing just that in Windward. The whole tooltip is just an example. Don't use it as-is. ;)

I'll do a video soon on how I've done the most recent UI in Windward and I'll explain all this. Here's what the function header looks like for UIGameTooltip.Show:
  1. static public void Show (string icon, Color color, string title, string text, string description)
Note that I pass an icon, icon background color, title, text and description all separately?

Tooltip's pivot is indeed top left by default. I'm not sure I see a use case for it being something else...

Appear delay -- this is just set on the UICamera, but I can imagine a use case for you wanting it to be configurable on a per-element basis. I'll give it some thought.

konsnos

  • Newbie
  • *
  • Thank You
  • -Given: 8
  • -Receive: 0
  • Posts: 26
    • View Profile
Re: [Request] Better Tooltip controls
« Reply #2 on: August 27, 2014, 02:16:28 AM »
Thanks for the response.

Tooltip's pivot is indeed top left by default. I'm not sure I see a use case for it being something else...

In my case it falls directly upon the button that activated it, hiding it.

Multiple text sizes... you can already achieve this just by using multiple labels in your tooltip. I'm doing just that in Windward. The whole tooltip is just an example. Don't use it as-is. ;)

Indeed that works. But it needs some tweaking when there is need for multiple tooltip formats. Eg. one for stats with small size labels that shows off stats, and one for button tooltips with just two labels with title and description.
I've added a function to swap the instances to implement that.