TooltipManager
Last updated
Last updated
Allows to visually indicate the current hovered Item ( If available ) in the Inventory. This action is not immediate, though, players need to hover the Item for a minimum amount of time before the Tooltip is enabled.
Additionally, Tooltips can contains Descriptions, as shown in the picture below:
dragImage: Image that displays the Icon of the current Dragged Item.
tooltip: Object that contains the Tooltip UI
rotateText: Text that displays the Input Keybind to rotate text ( only visible if using Tetris Inventory )
tooltipText: Text that displays the current hovered Item Name
tooltipDescription: Text that displays the current hovered Item Description
tooltipOffset: Offset Position added to the tooltip to avoid displaying it exactly on the mouse, for better readability
rightPadding: Horizontal space added to the text at the end of the line.
SetActive(bool value)
Visually enables or disables Tooltip and activates or deactivates it based on the given value
SetDragImageVisibility(bool visible, Sprite sprite, bool showRotateText)
Update Drag Image State ( Whether it is visible or not ) and the visuals to display
SetTooltipVisibility(bool visible, string name, string description)
Update Tooltip State ( Whether it is visible or not ) and the Item Parameters to represent ( Name & Description )
Disable()
Disables the Tooltip so it cannot be shown nor used.
Rotate(int rotation)
Rotates Drag Image. Used by Tetris Inventory only. Items in Grid Inventory cannot be rotated.
SetPosition(Vector2 pos)
Updates Tooltip Position in the UI