Author Topic: Use UITooltip's screen bounds functionality?  (Read 1413 times)

Majicpanda

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 83
    • View Profile
Use UITooltip's screen bounds functionality?
« on: March 14, 2014, 03:19:48 PM »
Is there any help in how to go about taking say a custom Prefab with a set of widgets on it and utilizing the UITooltip's way of ensuring the pop up is confined within the game window and also at the spot that the mouse is when the tooltip is called?

The background for my item tooltip is always the same size because it's very custom like Diablo 3 with images etc, so I would think this would be easier than even your UITooltip system that dynamically changes the tooltip size based on contents.  Just not sure how to extract the pieces out that I need.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Use UITooltip's screen bounds functionality?
« Reply #1 on: March 14, 2014, 08:13:23 PM »
NGUITools.Calculate series of functions can be used to figure out the cumulative widget bounds of the specified game object. Knowing the bounds as well as the screen dimensions you can offset it accordingly.