Preface: I’m using UE 5.4
Hey there, I’m working a game at the moment and I’ve come across an obstacle in the form of making custom tooltips for a stats screen. The issue seemed simple enough to fix, but I think I’ve run into more confusion than I’m willing to bare. I’ve looked through several tutorials and they all give varying information, all of which led me in different directions and so I’m here looking for a more specific answer to my issue, but I digress.
What I have:
A basic UI Widget that holds a stat window with several user widget text boxes (the “Text” field of the user widgets is set to editable and has indeed already been adjusted for each text widget in the main UI), as well as text widgets that are part of the main UI that show character stats (no problem with these).
A widget for the “stat label” text with a simple event structure to expose the text to the main UI blueprint (this is the original widget of the user widget instances in the first image).
A simple tooltip widget that has text widget exposed as a variable, and the text field bound to a text
variable, to be set as a description.
I have created a struct + data table that holds data about; the stats label text widget’s name (which is set in the editor already, so kind of redundant); and the tooltip description which is what should populate the tooltip that gets created when hovering over one of the user widget text boxes.
What I need:
I need to be able to set the text of the tooltip widget (stat label’s description, in this case) created when hovered over the instanced text widget. But I’m not sure which way to approach this, or if I’m doing this wrong or in some convoluted way.
Initially I had set out to do everything in the main widget itself (apart from the tooltip widget itself, which would bind to each text widget in the main UI) but was later put under the impression that things should be modular and use instances of a single widget within a parent widget (in this case, with my main UI). So currently have I have a hierarchy of Main UI > Stats Label Text Widget > Tooltip Widget
but I presume this is the wrong way to go about it.
Thing is, the text for these tooltips will never change. The stat labels will always remain the same, the tooltips are just there to give additional information, so is it even worth making this stuff modular?
Do I even need to use a struct and data table for this? Am I overcomplicating this? I’m having trouble wrapping my head around the logic because I’m not sure what is absolutely necessary to make this work and what is avoidable.