How to force tooltip to be ALWAYS on top?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Xyseer764

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.

enter image description here

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?

:bust_in_silhouette: Reply From: exuin

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?

exuin | 2021-05-15 18:48

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: enter image description here

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.

exuin | 2021-05-15 19:47

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

exuin | 2021-05-15 20:10