Improve make_canvas_position_local description

This commit is contained in:
kobewi 2024-10-24 14:39:45 +02:00
parent ff9fb0abea
commit e0c7e063e5
2 changed files with 7 additions and 3 deletions

View File

@ -533,9 +533,13 @@
</method>
<method name="make_canvas_position_local" qualifiers="const">
<return type="Vector2" />
<param index="0" name="screen_point" type="Vector2" />
<param index="0" name="viewport_point" type="Vector2" />
<description>
Assigns [param screen_point] as this node's new local transform.
Transforms [param viewport_point] from the viewport's coordinates to this node's local coordinates.
For the opposite operation, use [method get_global_transform_with_canvas].
[codeblock]
var viewport_point = get_global_transform_with_canvas() * local_point
[/codeblock]
</description>
</method>
<method name="make_input_local" qualifiers="const">

View File

@ -1253,7 +1253,7 @@ void CanvasItem::_bind_methods() {
ClassDB::bind_method(D_METHOD("force_update_transform"), &CanvasItem::force_update_transform);
ClassDB::bind_method(D_METHOD("make_canvas_position_local", "screen_point"), &CanvasItem::make_canvas_position_local);
ClassDB::bind_method(D_METHOD("make_canvas_position_local", "viewport_point"), &CanvasItem::make_canvas_position_local);
ClassDB::bind_method(D_METHOD("make_input_local", "event"), &CanvasItem::make_input_local);
ClassDB::bind_method(D_METHOD("set_visibility_layer", "layer"), &CanvasItem::set_visibility_layer);