@cybereality said:
That is exactly how a CanvasLayer is supposed to work by design. It allows you to place things on the screen in positions that do not move with the camera or viewport. If you need it to move, you should just delete the canvas layer altogether and have the color rect as a direct child, or parent it to a Control node if you need to adjust it further.
Hi it is just a try follow your advice here:
https://godotforums.org/discussion/comment/62902#Comment_62902
I want make a richtextlabel with a border, you said use ColorRect to make it. And I think it is a good idea. But when I try to make it I found that the ColorRect Node has no attributes about z-inex
or layer
. Seems cant modified the overlapping order.
Without change the z-index, the ColorRect Node will be on top of the RichTextLabel. The text on the richtextlabel is overlapped.

I do some research and found this:
https://www.reddit.com/r/godot/comments/c263uj/z_index_on_control_nodes/
Which tell me to use Canvas Layer as the parent of the ColorRect Node.
So I am little confused when the CanvasLayer wont follow the parent node.
The reason I want add border on richtextlabel is in my typing game, I want use the border to indicate the current focus word. If it is not easy to add border I just change the color of the richtextlabel also make it.