|Topic was automatically imported from the old Question2Answer platform.
I’ve been playing around, trying to implement a satisfying draggable window system for my UI and after getting it to work, I’ve noticed a problem; my tooltips don’t display correctly.
I’m using canvas layers along with Window Dialogs to achieve the intuitive layering of windows when the player tries to drag them (after researching how Godot handles layers, it seems to be the only sane way to handle layering), but unfortunately the layer also applies to the tooltip inside the Window Dialog. How could I go about trying to fix it, so that the tooltip is always on top?
I believe the default tooltip isn’t really accessible through current methods in Godot. You can alter it, but you can’t change the layer on which appears. You might want to instead implement your own tooltip.
Yep,I scoured the documentation and unfortunately came to the same conclusion. It’s really a shame we’re not able to access the tooltip object - it’s a really handy built-in feature, but essentially useless when you’re trying to do something a little more complex, because of its protected status.
Xyseer764 | 2021-05-15 18:46
Maybe you can request for it to be more accessible on GitHub?
Actually, I found out that
_make_custom_tooltip(value) allows you to really easily implement custom tooltips - I simply created a custom node with a canvas layer and a label. Unfortunately, it took me a really long time to find, plus I was initially afraid that it’ll require a lot of additional work, forcing me to re-implement the tooltip system from scratch, but turns out Godot lets you intercept the tooltip object, it just does it in a roundabout way. Currently, it works exactly as I originally intended:
Xyseer764 | 2021-05-15 19:43
Oh that’s nice. I thought that since the node had to be a control you couldn’t put a canvas layer on it.
Oh, my apologies, I miss-wrote. I created a Canvas Layer and a Label, but they were separate - I’m simply making the tooltip the child of a special Canvas Layer, specifically reserved for tooltips, when instancing it.
Xyseer764 | 2021-05-15 20:06
Oh alright thanks for clarifying