godotengine / godotengine/godot
BBCode's Hint tooltip not showing while following viewport
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
- Reproducible in: 4.2.stable, 4.2.rc2, and 4.3.dev5
### System information
Godot v4.2.stable - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3050 Laptop GPU (NVIDIA; 31.0.15.2802) - AMD Ryzen 7 4800H with Radeon Graphics (16 Threads)
### Issue description
The tooltip for BBcode's Hint tag does not appear if the scene also have Camera2D while the RichTextLabel that contain the hinted-text is outside of CanvasLayer or inside CanvasLayer that have followed viewport enable.
We expected it still be able to display the tooltip, as meta signals for url tag still work even when they are in the same situation. Our guess is "maybe the issue isn't with the hitbox but the position of the tooltip instead".
### Steps to reproduce
**Outside of CanvasLayer case**
1. Create an empty 2D scene
2. Add RichTextLabel as a child of the scene
3. Enable RichTextLabel's BBcode
4. Put `[hint=tooltip text displayed on hover]text[/hint]` into the RichTextLabel's text box
5. Add Camera2D into the scene
6. Run Current scene
7. Try to hover the text, the tooltip will never show up
**Inside CanvasLayer case**
1. Create an empty 2D scene
2. Add CanvasLayer as a child of the scene
3. Enable CanvasLayer's Follow viewport
4. Add RichTextLabel as a child of the CanvasLayer
5. Enable RichTextLabel's BBcode
6. Put `[hint=tooltip text displayed on hover]text[/hint]` into the RichTextLabel's text box
7. Add Camera2D into the scene
8. Run Current scene
9. Try to hover the text, the tooltip will never show up
If you were to disable CanvasLayer's Follow viewport and run Current scene again, the tooltip will show up and vice versa.
### Minimal reproduction project (MRP)
[HintToolTipCameraBug.zip](https://github.com/godotengine/godot/files/14718616/HintToolTipCameraBug.zip)
Contributor guide
Research direction
Start by running the linked HintToolTipCameraBug.zip reproduction and compare RichTextLabel hint tooltips with Camera2D, both outside CanvasLayer and inside a CanvasLayer with Follow viewport enabled. Trace the tooltip behavior in the RichTextLabel BBCode hint path; done means the tooltip appears in both viewport configurations while the existing reproduction steps still work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100