[UE4] Unreal Engine 4 Custom Tooltip Tutorial - 4.18.2
How to create a fast custom tooltip using macro.
- First create a widget with a Text that will be your custom tooltip. PS: Make the Border ‘Size to Content’.
- At the Graph of this widget, create a variable text and mark ‘Instance Editable’ and ‘Expose on Spawn’. This will make your tooltip request a ‘Text’ when created.
- At the Designer, bind the Widget Text with the variable text created. Any change to the variable will change text of the widget.
- Now create a Macro for your User Widget. Select to create a Blueprint Macro Library at Blueprints and select User Widget. PS: This macro will make adding the tooltip faster.
- Inside of your new User Widget Macro create a function. The input will receive a generic Widget that you will ‘Get Tooltip Text’ and execute a ‘Create Widget’ selecting the Tooltip Widget created before. Returning the widget created.
6. Now Inside of other widget that you want to add a tooltip, SELECT the part of your widget that you want to create a custom tooltip and create a binding in ‘Tooltip Tip Widget’ in Details. Ex.: Select a Button of your widget and look at ‘Details’ normally in the right. PS.: Add a tooltip text in this part of the widget.
- Inside the binding you created, now only need to add the Macro that was created and link the part of the widget that you are binding.
- Aaaand it’s done.
This is a fast way to created a custom widget and add to every part of your widgets, because the macro can be call for every widget in the game only requesting the widget that have the tooltip text.