godotengine / godotengine/godot-docs

ScrollContainer: Add info about conditions to make this node work and RichTextLabel scrolling interfering with it.

Open
#4,195 0 comments 0 reactions 0 assignees View on GitHub
area:class reference enhancement
Dominant language
reStructuredText
Stars
5.7k
Forks
3.8k
Avg merge
1d 20h
Merged PRs (30d)
25

Description

**Your Godot version:** 3.2.3

**Issue description:**
Add info that scrolling will only work when there is not only a VboxContainer or HboxContainer node as child,
but that this configuration also must have a **Control based node as child** (other than the RichTextLabel) which has to have **_content_** that **must extend over** the ScrollContainer rect_size. In any other condition scrolling will not work, and there is no error message or any other kind of hint as to why it does not work as expected.
A control based node who's rect_size is bigger than the ScrollContainer rect_size will not make the scrolling work by itself. The rect_size does not matter, if it has content and a bigger rect_size does not matter, the only thing that will make the scrolling appear is if the Control based child of ScrollContainer+VboxContainer/HboxContainer _**content**_ outside of ScrollContainer rect_size (like text in a Label node, note that it does not work with RichTextLabel).

This also applies if Node2D based childs are added. The Node2D based nodes by themselves won't cause the scrolling to appear, even if they extend the ScrollContainer rect_size. Only with a Sibling or parent Control based node and only if that control based nodes extends the ScrollContainer rect_size does the scrolling work and the scroll bars appear.

Also note that ScrollContainer+VboxContainer+RichTextLabel does not propagate the rect_size (possibly a bug), and currently has to set manually (dragging is not possible as there are no corner handles) or another Control as parent has to be added in front of the RTL. After the RTL rect size has been set manually in the Inspector, it shows up in the Editor, but is gone when running the game.
There is also no warning or UI indication of this, the RTL just disappears. Therefore it would be necessary to add a warning telling people to add a Control node as a parent if they want the RTL to work.

Also adding a RTL node completely removes the scrolling functionality of the ScrollContainer+box node, even if the scrolling in the RTL itself works if it has the Control parent. Probably also worth a mention I would reckon.

**URL to the documentation page (if already existing):**
https://docs.godotengine.org/en/3.2/classes/class_scrollcontainer.html

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.