godotengine / godot-docs

Godot Engine official documentation
https://docs.godotengine.org
Other
3.91k stars 3.2k forks source link

CanvasLayer documentation outdated/incorrect. #7791

Open diquah opened 1 year ago

diquah commented 1 year ago

Your Godot version: 4.1.1

Issue description: The documentation says: "Note: Embedded Windows are placed on layer 1024. CanvasItems on layers 1025 and higher appear in front of embedded windows." However, CanvasLayers seemed to be limited to the range of (-128, 128). Given that, what layer are embedded windows displayed at?

Additionally, the type of the Layer property is listed as "int" which links to a page describing a signed 64-bit integer type.

URL to the documentation page: https://docs.godotengine.org/en/stable/classes/class_canvaslayer.html

AThousandShips commented 1 year ago

Additionally, the type of the Layer property is listed as "int" which links to a page describing a signed 64-bit integer type.

In what way is this wrong?

diquah commented 1 year ago

In what way is this wrong?

The value described as a 64 bit integer is limited to the range (-128, 128) in the editor. Even if the number is stored as a 64-bit integer (I'm not sure if it is as I am unfamiliar with the engine's code) the documentation is a little misleading as the editor only allows a value between (-128 and 128) which is a far smaller range than a 64-bit integer number provides.

Perhaps a type of "int (from range -128, 128)" or some equivalent would be more suitable.

The main issue is I'm not sure what layer embedded windows are displayed at and the documentation seems to be for an older version of Godot.

AThousandShips commented 1 year ago

We don't have that kind of annotation, so it's not an issue in the documentation, the return value is an int, i.e. an int64, the documentation should make the range clear

However it is just the property that is clamped, I don't think it's locked internally

And the part about embedded windows is true, they are on layer 1024